Zurück zu Willert.de

when use use-case diagram and when use class diagram?

If your question doesn't fit in any other category below ask in here.

when use use-case diagram and when use class diagram?

Postby mintux » October 31st, 2013, 1:02 pm

i'm php developer using MVC architecture that i'm new to UML
i know use-case , class , object , activity, sequence diagrams but i don't know for modeling a application where i should start.
i know use-case and class diagrams are structural diagrams and activity and sequence are behavior diagrams

but my questions are:
1. for modeling a app when i should use use-case diagram and when i should use class diagram?
2. does class diagram has abstract concept? because when i'm developing web app i have some controller and model or view also several classes that i use for different purpose (like insert data to database - validate form inputs and so on) but they don't look like to examples of class diagram that i'v seen until now so my question is class diagram is used for show concept of our system and it doesn't need to generate real class code form it ?

for example modeling a ticket reservation that may have some classes like this:
Image
but we don't write class codes like this and it can be different in programming but for view the concept we are using class diagrams . is it true ?
mintux
 
Posts: 3
Joined: October 31st, 2013, 12:55 pm

Re: when use use-case diagram and when use class diagram?

Postby fsjunior » November 5th, 2013, 1:15 pm

I don't know about UML and PHP, and I don't know if you're using some tool to generate code from your diagrams, but I'll try to answer your question with more general UML knowledge:


1) This is a personal opinion, but I think you don't need to use all avaliable UML diagrams. You need to define a engineering process and how to use each diagram that you previously defined engineering process. Generaly, you use use cases diagram early in development process. You use it to identify... use cases of your system and help you to refine the requirements of your system.

2) What is abstract concept? You mean like this: http://en.wikipedia.org/wiki/Abstract_type ? If it is, then, yes, it have. Search about generalization and abstract methods/operations in class/object diagrams.


"but we don't write class codes like this and it can be different in programming but for view the concept we are using class diagrams . is it true ?"

Maybe I don't understand what you said, but some things that I have in mind:

1) UML is not designed for a specific Object Oriented Programming language. It is general. Problably, if you use some very language specific feature, you have to change the "way that you program" to fit into the "UML way". Or adapt the "UML way" for "your way".

2) What is the point to have the "programming" different of the modeled concept in UML?
Last edited by fsjunior on November 5th, 2013, 7:38 pm, edited 2 times in total.
fsjunior
 
Posts: 19
Joined: March 22nd, 2013, 8:15 pm

Re: when use use-case diagram and when use class diagram?

Postby mintux » November 5th, 2013, 2:43 pm

Thanks for your answer
actually i understood i should change my mind for OOA and OOD from OOP
and in practice we use object and class concept to model or analyse our problem
this was the problem i faced to it (conflict two concept OOA and OOP) we should suppose we don't want write any code and we don't know any programming language but we want to model and analyse our problem in Class/Object concept and after modeling is completed then see how to write code for it and we don't have to write code like what we designed in class diagram.it should only follow that way we designed in UML

Thanks again
mintux
 
Posts: 3
Joined: October 31st, 2013, 12:55 pm

Re: when use use-case diagram and when use class diagram?

Postby fsjunior » November 5th, 2013, 9:49 pm

Hi again.

Again, I don't know if I understand well what you mean or if I'm able to help you. But I'll try:

IMHO, I don't think that we should modelling a software supposing that we don't want write code. UML is supposed to be "language agnostic", except that must be used with an OOP language. But this doesn't mean that UML is "language atheist". In the final, you're modeling precisely to help you to create the code. So you must have this on mind.

I think that you must have on mind that "every" construction in UML have a paralel in programming language: the class in the class diagram, creates a class in your code; the association in your class, create a member in your class with maybe a getter and setter, and so on. So, when you're modeling, you're defining what code must be created (automatically or not).

What I say makes sense to you?

Is very easy to me think in this way because I use the IBM Rational Rhapsody, that automatically generate source code from the modeled UML. But Rhapsody is mostly for embedded systems, and I think that there is no version for PHP.
fsjunior
 
Posts: 19
Joined: March 22nd, 2013, 8:15 pm


Return to General Question

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron