• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Class Diagram and Use Cases

 
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have just started learning UML and modelling. I have learnt drawing class diagrams and have also read a little on use cases. I have not worked on UML other diagrams yet.
1. Uses cases are very useful for usability evaluation of a system. Other than that, how can they be mapped to a class diagram view of a system.
2. How relevant are use case diagrams for back end systems which often perform batch - like jobs?
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The most that you can expect to map to a class diagram from a use case would be by way of the nouns used in the use case. Aside from that, there is really not a whole lot you can do to relate the two. Use cases are better used in conjunction with interaction diagrams, which show the messages sent between several classes for a single use case.
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Shubhrajit Chatterjee:
1. Uses cases are very useful for usability evaluation of a system. Other than that, how can they be mapped to a class diagram view of a system.


Use cases aren't really made for the same purpose as a class diagram.
A use case diagram displays the functional requirements of the system. What can the system do? These questions are answered by a use case diagram. Some processes take this to the extreme stating that every functional requirement should be captured within a use case diagram. Other processes are more lenient.
However, a class diagram does not show the functional requirements of the system. It shows the components of the system and how they relate to one another.
Due to the fact that they display different information, they are difficult to map to one another.
One key process to note, however, is that you should be able to generate a sequence diagram from your class diagram that would successfully complete each of your use cases. This is how you can "map" your design back to your requirements.


2. How relevant are use case diagrams for back end systems which often perform batch - like jobs?


As far as back-end systems go, you might want to portray the front-end systems that utilize your back-end as an external user. Even though it's not a person, it still makes requests of the back-end in much the same way.
Corey
[ June 04, 2002: Message edited by: Corey McGlone ]
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wouldn't use cases also help identify the
control/boundary classes?
Thanks,
PJ
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Prashanth Joisha:
Wouldn't use cases also help identify the
control/boundary classes?


I'm sorry, but I'm at a bit of a loss with the terminology...what is a control/boundary class?
 
pjoisha
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Boundary classes are ones that interface with the
user - like the servlets
Control classes control the workflow like the
Session Beans
Enterprise programming with Java and UML has
excellent coverage on these topics
PJ
[ June 05, 2002: Message edited by: Prashanth Joisha ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Prashanth Joisha:
Boundary classes are ones that interface with the user - like the servlets
Control classes control the workflow like the
Session Beans


So how would use cases help identify them?
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Prashanth Joisha:
Enterprise programming with Java and UML has
excellent coverage on these topics


Do you mean the book "Enterprise Java with UML" by Arrington? I couldn't find a book with exactly the title you mention.
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Junilu Lacar:
The most that you can expect to map to a class diagram from a use case would be by way of the nouns used in the use case.


Even here, you have to be careful. There is a difference between "use case" and "use case scenario". Generally use cases are pretty generic in their description; probably better for a first cut at understanding the project scope and the key integration issues.

Scenarios are more concrete, more detailed, more likely to reveal all the issues... but you have to derive the abstractions from them at some point. Basically they help you to elaborate the use cases until they are robust enough for proper modelling.
At least, that is what I've read. Can't claim I've put a lot of thought into the issue myself. Some authors just warn that simplistic use case models get you so focused on the interactions that you can end up creating poor-quality OO models that won't stand up.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:

So how would use cases help identify them?


I think I'm with Ilja on this one. How would a use case diagram, which depicts the functions of a system, lead you to the creating of servlets and the like? Perhaps, it could lead you to the GUI's you'd need but, if you're using a MVC approach with JSP's as the view, you're still not getting into the servlets.
I've never really seen a direct relation between a use case diagram and a class diagram.
Corey
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Reid M. Pinchback:

Even here, you have to be careful. There is a difference between "use case" and "use case scenario".


When I think of a use case, I usually think of a single function of the system. For example, logging in.
Now, there would be multiple scenarios for each use case. In the example of logging in, you would probably have a scenario of logging in successfully, not logging in successfully, and possibly one more for locking the system from an intruder. These scenarios are concrete situations that can occur and a sequence diagram can be created that describes the execution path for each one. It is from these scenarios to the sequence diagram that I see the link between the Use Case diagram and the Class diagram.
Anyone have any further thoughts on this?
Corey
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree for the most part; by using the scenarios of the use case you are working through the concrete activities much the same way I believe people use CRC cards. One of the claimed benefits of a CRC card session was that by using your classes in a realistic interaction you sometimes you would encounter a missing concept. That I think is why some authors worry about people getting too caught up in use case descriptions without including the concrete scenarios; it was too easy to think you were 'done' when you really had more classes to uncover during the analysis.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic