Re: ScriptInput Class?


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Greg Grothaus on March 19, 2001 at 12:24:11:

In Reply to: Re: ScriptInput Class? posted by Tyler Woods on March 18, 2001 at 18:57:34:

: : : The design requirements say that the template, the books, the authors, the database, and the manager all cannot do any file input. Fine. Then it goes on to say that the ScriptInput class is for reading in the script file and we can have a LogOutput file for outputting the log file. But there are 2 other files involved, the two databases. Should we create DatabaseInput classes as well, or just rename ScriptInput to FileInput and use it to input the other commands. Also, which class (manager or database) would be responsible for requesting that data from the FileInput class. Does it matter?

: : : PS: This text input box needs a wrap parameter for those of us using netscape.

: : You shouldn't have to. If you have a properly designed Input class, you can use the same class to read in the data base input files as you could to read in the script file. Remember, your input class is not doing "ANY" interpretation of the input file. Which means, if you have to have 2 separate classes... you're not following the specs. All your input class should do is read the file and return a series of "tokens". I think I'll be able to completely reuse my FileManager class from P1... if im lucky... Hope this helps.

: : Tyler

: I've been thinking about this a little more and I think I misread you're question. Are you asking if there should be separate instances for these classes or separate classes altogether? If you're talking about two completely separate classes, then no. You don't need to (for the reasons I just posted) but if you're talking about separate instances. Maybe. I'm trying to decide if I'm gonna have a "LoadBookDatabase" and "LoadAuthorDatabase" function in my Manager class or if I'm gonna have a universal "FileInput" stream that can have its file association re-assigned when necessary. Back to more thinking.

: Tyler

I agree that a basic tokenizing class would work fine, but the spec says specifically that we must have a CLASS called "ScriptInput". It would most definitely be bad form to make a "ScriptInput" type class input something besides scripts - ie: a database. Now if "ScriptInput" was a instance, rather than a class - that would make sense.

It does make sense to load the databases within the manager class though, such that you could read in a size before creating the database class instance.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]