Discuss OO Design Collections in the Software Design forum on Dev Shed. OO Design Collections Software design forum discussing design principles and non-language specific algorithms. Get help with logic, algebraic, or relational concepts.
Time spent in forums: 3 Weeks 5 Days 12 h 51 m 9 sec
Reputation Power: 886
We don't do your homework here, but we'd be happy to help if you exhibit some level of motivation that goes beyond pleading for help. Perhaps you could start by asking a sensible question that doesn't imply having us do all the work for you?
Are you a computer science student? What year?
What have you covered in class so far?
I no longer wish to be associated with this site.
Time spent in forums: 3 Weeks 5 Days 12 h 59 m 16 sec
Reputation Power: 1681
Okay, how about instead of an answer some hints to help you start thinking of an answer? I think that's a fair compromise.
Remember that OO is all about interactions between intelligent agents (aka objects: encapsulated state + behavior). That means that an object-oriented design should have the following characteristics: messaging, local retention and protection and hiding of state-process, late-binding (polymorphism, duck-typing, etc). Inheritance is not part of the core principles of OO, but rather a language extension, so you don't need it unless it simplfies your design.
The next step is to think about the domain model (cargo transportation). Can you generalize out milk as a just the contents of the cargo? There may be other cargo types that add constraints, e.g. toxic. The cargo containers may be of different sizes so filling vessles may have different approaches (e.g. greedy algorithm). There may be different scheduling types to minimize an attribute (cost, shipping time, etc). All of these things may need to be modelled in an industrial-strength application.
Now your requirements are quite simple, so recognize the domain model but keep it limitted to your use-case. Think about the roles, responsibilities, and collaborations required to solve the problem. Ensure that no single role is too big, distribute intelligence, and preserve flexibility.
Spend some type scratching out ideas on a sheet of paper or whiteboard. Once you have something you like, then post it for our feedback.
Core design principles when developing software systems.
See my open-source project as an example of professional code.
The opinions expressed do not represent those of my employer.
Time spent in forums: 13 h 1 m 15 sec
Reputation Power: 4
I also know that almost everyone who teaches object orientation uses the class as a fundamental building block. Such an approach misses the central point of object orientation: the objects themselves, and what they portend for flexibility and effective design. No prior knowledge of object orientation is assumed, though some knowledge of Java or other high level programming language is required. Thanks and like to share.