Re: [UML Forum] Is this Usecase diagram correct for My Project Plan

100 views
Skip to first unread message

H. S. Lahman

unread,
May 27, 2013, 12:36:19 PM5/27/13
to umlf...@googlegroups.com
Responding to Fauzi...

I'm working on an usecase diagram before build an application (using ruby on rails).

Association Model (plan) :

  • student has_one user
  • teacher has_one user
  • user belongs_to student
  • user belongs_to teacher
  • user has_many topic
  • user has_many comment
  • topic belongs_to user
  • comment belongs_to user

Attribute Per Model (plan) :

I'm using two devise model : one devise for student authentication and other devise for teacher authentication.

  • student : id, username, password, name, nis
  • teacher : id, email, password, name, nip
  • user : id, student_id, teacher_id (for logic : if student has_one user, teacher_id is empty and if teacher has_one user, student_id is empty)

Uh... This is all the model solution -- a Class diagram. Your first sentence indicated you were doing the use case before the application. B-)

Here's scenario for usecase :

  • A student as a user make a topic and a comment required login student
  • A teacher as a user make a topic and a comment to topic required login teacher

Note the 'and'; all users seems to do both. If you separate Post Topic and Leave Comment, your use case diagram needs to make it clear the user interaction involves both.

I am not sure why there is no "to topic" in the first line. Why is that difference important?

I've made a usecase, but I'm not sure this is true for my plan. 

I know All users (student and teacher) can create a topic and add comments but teacher and student are different model.


Question : Should I make include post topic and leave comment to login student and login teacher? If that's wrong, how to  correct of use case for my project plan?


I would bet that Login Teacher and Login Student are not very different -- probably just somehow preserving the type of user for subsequent processing. If so, you only need one Login use case that has a steps like "get user type from DB" and "save user type". (Note that you might handle this in the UI by actually having separate login screens. However, that decision is part of the implementation of a design strategy for solution. Use cases define requirements and the customer doesn't care how the software keeps track of teaches and students -- the requirements just insist that the software does keep track of them somehow.)

The real interactions with the application are Leave Comment and Post Topic.  Is there a required sequence (i.e., a topic must be created before a comment is left)? If so, both Teacher and Student would interact with Post Topic and Post Topic would interact with Leave Comment. Login would be an <<include>> for just Post Topic.

However, if topics can be created and comments left at different times (i.e., in different interactions with the software), then your diagram is correct except that Teacher and Student both interact with both Post Topic and Leave Comment and you <probably> only need one included Login.

The third situation occurs when topics and comments can be posted either separately or in the same interaction (login session). Now you have the problem that Login is only executed for both when there are separate interactions. Therefore <<extend>> would be better because it implies a conditional execution. Assuming topics must be posted before comments, you would also need and <<extend>> between Post Topic and Leave Comment for the case where the user does both in the same session.

-- 
Life is the only flaw in an otherwise perfect nonexistence
   -- Schopenhauer

Imagine how much more difficult physics would be if electrons had feelings
   -- Richard Feynman

Rene Descartes went into a bar. The bartender asked if he would like a drink. Descartes said, "I think not," and disappeared.

H. S. Lahman
H.la...@verizon.net
website: http://www.hslahman.com/
software blog: http://pathfinderpeople.blogs.com/hslahman/index.html
software book: Model Based Development, Addison-Wesley, 2011
geology book: The Evolution and Utilization of Marine Resources, MIT Press, 1972

H. S. Lahman

unread,
May 28, 2013, 5:42:20 PM5/28/13
to umlf...@googlegroups.com
Fauzi,


Yes, I can make the same, if teachers and students are both user and I can make a usecase like this


If Login is <<include>> in Post Topic, it is impilicitly accessed by the User when Post Topic is activated. You would not normally need a separate Actor connection to Login. You can also have Teacher and Student both interact with Post Topic.

But Lets say between teacher and student is different ( because I get a project that required like it T_T  ) and I have to create more usecases with condition : student and teacher are different. If my project plan and case  like it, what do I have to do to create a usecase ?

I don't know what T_T is. However, conditional steps within a use case are quite legal. If the conditional processing is extensive, you can break it out as a separate use case with <<extend>>. Usually <<extend>> means that it extends the parent only in some circumstances; if it always extends it, then one uses <<include>> because it is always executed.


I tried to make usecase again, and verify it with software. Is this true? See, I passed the verification of rules uml :



Unfortunately I don't know what this means because I can't read it at my mailer's display scale and when I copy it, is is greeked when I blow it up. (You should attach figures so they can be properly imported to an app to be blown up.)


I mean like this : 
  • A student as a user make a comment  before create  a topic required login student
  • A teacher as a user make a comment before create a topic required login teacher
 As in this forum : I make a topic, me and you comment my topic :D

This is inconsistent. The last line says comments are made to existing topics while the two lines above it say comments are made before topics are created.

In either case, I'm afraid you have not clarified very much.

Q1: Can both teachers and students create topics?

Q2: Are comments attached only to topics or can they be attached to existing comments?

Q3: Can a user create a topic and provide a comment to an existing topic in different interactions (i.e., at different times)?

I am guessing that either a teacher or a student can create a topic. When they do so, they also leave a comment at that time. Then the other type of user can login and just leave a comment related to that topic. If so, then my third situation would apply.
Reply all
Reply to author
Forward
0 new messages