dcsimg
UML - How to identify possible methods for a class?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Squirrel_John
Posted On:   Saturday, April 14, 2001 11:59 AM

Dear Sir, I have created a class diagram using UML notation for a "Video Rental System", but I am stuck when I am trying to identify the possible methods for the main class called "Video". Here is the brief scenario of the case study: -Distributor supplies tape to warehouse. -Warehouse then makes payment and catalogues the tape. -Each video store will select there desired tape (or video) from the warehouse and then catalogues them. -Later it can be rented or sold to customers. -Customers can also make reservation which will be hold for 3days. -Customers can also give suggestions of new tapes. Appreciate your help. T   More>>

Dear Sir,

I have created a class diagram using UML notation for a "Video Rental System",
but I am stuck when I am trying to identify the possible methods
for the main class called "Video".

Here is the brief scenario of the case study:
-Distributor supplies tape to warehouse.
-Warehouse then makes payment and catalogues the tape.
-Each video store will select there desired tape (or video)
from the warehouse and then catalogues them.
-Later it can be rented or sold to customers.
-Customers can also make reservation which will be hold for
3days.
-Customers can also give suggestions of new tapes.

Appreciate your help.

Thank you.

   <<Less

Re: UML - How to identify possible methods for a class?

Posted By:   Simon_Ablett  
Posted On:   Monday, July 2, 2001 07:05 AM

John
OO is behaviour as opposed to data centric. The methods you use for your class should either match the perceived behaviour of that class or should provide safe access to the class' state (i.e. it's attributes). There's no quick answer to your question it all depends on the problem domain. One small point. Remember that if you are using an RDBMS, trying to obtain a one-to-one correlation between your classes and the tables used to store their state may not result in an optimal solution (relational database systems are data centric by definition).
Regards.

Re: UML - How to identify possible methods for a class?

Posted By:   jim_conallen  
Posted On:   Tuesday, April 24, 2001 06:55 AM

First this is really a question related to object oriented analysis and
design - not UML in particular. Indeed, the problem statement and scenario
you outline here is really quite encompassing and I could see it easily
expanding out in to a half a dozen use cases, and a 10 page non-functional
requirements document. The proper answer to your problem is to point you
to software development process's (see
What process should I
follow for object-oriented analysis and design?
).
I currently favor the Rational Unified Process (RUP), in part because I think it is
the most comprehensive and most flexible process framework out there, and secondly
because I happen to work for that company (and my boss might be monitoring this forum
:-). Philippe Krutchen has an excellent introduction to the process.


Another process that is receiving some press is eXtreme Programming.
To steal an often heard analogy between these two processes, RUP is to Classical Music,
as XP is to Jazz. Both deliver complex and beautiful music. Classical is often performed
with a large orchestra where each member has its role, and each requires a different level
of skill. The members act as a team, with solos being rare. Jazz, on the other hand
can be performed with a smaller group, where most are highly skilled (in pair programming
mentor's are paired with junior members), and a lot of the music is unstructured and subject
to the flows and ebbs of the moment (making it easier to adapt to certain changes).



I personally have never been on an XP team, so I can't really vouch for its
effectiveness, but have had much success with RUP variants.



To address the details of your question, I did a quick scan of the statement. First you need
to define some use cases (Update Warehouse, Catalog Tape, Rent/Buy Tape, Make Reservation, etc.).
Doing some use case analysis and
some design, I've identified
two actors in your description (Distributor/warehouse clerk, and Customer), but there are bound to be more
including the often forgotten system administrator. Never underestimate the number of use cases
and work that needs to be made to support system maintenance!


I've also identified a number of entities (Tape, Warehouse Inventory, Payment, Video
Store, Reservation) and controllers (Make Payment, Catalog, Suggest Tape, Rent/Sell Video). From
here you need to express the scenarios in more detail, associate them with the use cases
and in general find more analysis classes and add a few user interfaces.


So the really answer to your question is to find a process understand and accept it, and then
follow it. Use the process John, ... use the process...

About | Sitemap | Contact