help me
1 posts in topic
Flat View  Flat View

Posted By:   jode_silver
Posted On:   Friday, March 5, 2004 05:21 AM

i am a student at bournemouth university and i am reading computer programming and business studies. i have juat recieved a UML assignment. i am having problems identifing the super class. i have got a case study about a maintiance services company. i have identified the attributes as:
Customer, Employee, Job, Service, Quote, Invoice, Wages, Payment and Materials

Also i am having trouble deciding wether a class is abstract or not. and of course multiplicity?????

can anyone help me on this tricky assignment? any help on this assignment will be helpfull.

thanks jodie

Re: help me

Posted By:   Stephen_McConnell  
Posted On:   Friday, March 5, 2004 06:52 AM

I know the feeling. When I was learning OO development, I thought it an absolute mystery that some people could look at a problem and see what the Objects should be... And then as I began to work with it, it became what I call a "Blinding Glimpse of the Obvious" (BGO's).

You have done a pretty good job of defining what you call the attributes... actually they are individual classes/objects.

The way to define what is a "super class" is to look at all the Classes you have and look for commonalities. Probably the only two classes that have some things in common are the Customer and Employee... and they have things like name, address etc etc.... but they have different behaviors... The customer gets a service from the company and the employee provides the service. One could create a Parent class (or super class) called Person with some attributes common to both... and then extend that class to the Customer and the Employee to implment the specific individual behaviors.

Now, the Job class has is "composed" of things like Service, Quote, Invoice, Payment and Materials. There is probably just one Service, one Quote... but there can be multiple invoices and multiple payments and multiple Materials... So you would have the Job Class hold one Service, one Quote... and a "Collection" of Invoices, collection of Payments, collection of Materials...

As far as an abstract class.. You don't have to use abstract classes. Usually you use abstract classes when you have a bunch of classes that implement a common method the same AND also have a common method that they all implement differently...

For example a vehicle could be a car, a bicycle, a cart, a motercycle... The abstract class would be vehicle, it would implment abstract methods of turn left, turn right, back up.... because each vechicle does this, but implements it differntly....

In java we have the "Interface" which is sort of an abstract class, but is just used to define the methods without having to have a concrete implementation of any method in a "super" abstract class.

You might want to get a couple of books... Thinking In Java by Bruce Eckel is a good book for describing Java Object development....

Good Luck and I hope this helps.

Stephen Mcconnell

About | Sitemap | Contact