This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello,I could use some help for my assignment!
It's a little bit complicated so I'll try to keep it simple.
I have to make a dvd club application which keeps a catalog with movies/games for rent.
Each movie has different categories such as: action,comedy,drama,romance. Each move belongs to one or more of these categories.
The characteristics of the movies are: director,actors,year of production,duration and categories.
For games (categories like: FPS,strategy,sport etc) and characteristics : platform,year,categories.
So,there's is a catalog with the rented movies/games and a catalog with the available movies/games.
Characteristics of the rent are: rent serial(unique number),game/movie rented,customer(name,number,address),day of rent,how many days were rented,price,price for extra day.
I wont bother you with the further implementation,I just need a little help with the construction of the hierarchies here.
So far,I created a class Rent in which I use composition with the class Movies,class Games,class Date and Class Customer(Used them as field members for class Rent).
Also I made class Rent a superclass of classes Movies and Games. Does this make any sense?
That's what I'm trying to do,but I can't relate things quite well.
My main concern is that while Rent has some fields that Movies and Games classes could use in common(and that means I can use inheritance,with the Rent class as a superclass),on the other hand the Rent class doesnt seem to act as a superclass in a logical way(for example Movie is not a Rent).
Hmm I feel a little narrow minded here hadnt thought about creating a class Product or something, to inherit movies and games classes and then use composition in rent class. That should work fine,thank you.
Joined: Oct 13, 2005
John de Michele wrote: . . . added an erase() method?
Yes, but I have 2 inch long eraser which I got for about 89p (about €1.00 or US$1.35), so I can bounce it about or wave it at our undergraduates and say, "This is the bit of hardware you really need!"
Hey,after I mastered my pencil (and eraser) skills, I'm back with another question
So,the tutor said that we have to create two collections (one for the available dvds and one for the rented dvds)
I'm totally irrelative with collections as I only had experience with simple arrays.
Which collection do you think would suit me better in this occation and why?