Prasanna Raman wrote:Actually, my scenario is I know the number of b/w and colour pages to print. So I'm taking those as arguments. I have this:
Prasanna Raman wrote:yes, a single job can have 10 b/w pages and 10 colour pages.
Prasanna Raman wrote:Oh, and would you tell me how the PrintConfigs class look like now, with the addition of the Joblet class?
Prasanna Raman wrote:Sorry, are you talking about PrintConfig (singular) or PrintConfigs(plural)?
PrintConfig doesn't know anything about the Joblet class. The Joblet class has-a PrintConfig instance and a numberOfPages. --
If it's singular, how does PrintConnfigs (plural) do loadDefaultCosts now?
Prasanna Raman wrote:I have the following. I think I'm confused about how PrintConfig should calculate cost. I have a circular dependency between cost methods of PrintConfig and PrintConfigs now
Prasanna Raman wrote:Thank you. I think I'm understanding this a little better now So, who would call the loadDefaultCosts method then?
Would it be the Application class that reads from file?
Prasanna Raman wrote:Because I am not reading cost from file today, I have an overloaded constructor in PrintConfig to let my main method create PrintConfig without cost. Is this ok or is there a better way?
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database