in reply to Determining what new and init methods do

I would expect new to create a new object representing a file. I wouldn't expect the creation of a file when calling new though. Maybe createFile and loadFile both call new with the file name, create would just create it first. Then you have the common code in new, and the specific codes for createing or loading in seperate methods. You could then also have a createOrLoadFile that does both and your code doesn't even have to care if the file exists yet or not.


___________
Eric Hodges
  • Comment on Re: Determining what new and init methods do

Replies are listed 'Best First'.
Re^2: Determining what new and init methods do
by talexb (Chancellor) on Oct 26, 2007 at 15:45 UTC
      Maybe createFile and loadFile both call new with the file name, create would just create it first.

    That's it -- thank you.

    That's one disadvantage to working on a one-man team -- no one in meatspace to bounce things of. Now I need to change some tests and get moving again. :)

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds