0

I am currently refreshing/altering my knowledge in software development because I will work in this area soon. We have learned a lot about UML diagrams and coding at University, but I have never brought it all together in a real Project. Therefore, I started to create a test web-app in Grails, and I wanted to begin with a requirements analysis and use cases too keep it close to reality.

My web-app should allow users to share recipes, find recipes and review recipes by other users. Every recipe has many ingredients, which are not just strings but rather entities so that calories, fat, protein and carbs can be used to automatically calculate nutrition facts of a certain recipe.

An ingredient can be added to the database by either a consumer or nutrition expert. If it is created by a consumer, it is only a "prospective" ingredient, meaning that it has to be verified by an administrator to become a "proper" ingredient -- otherwise it is marked, e.g. red text color.

This is my current use case diagram:

http://ubuntuone.com/0zDw9kEbj1BwtXjnCtxdwC

My question here is:

  • If I use include or extend, will I have to use the same primary actors for those extending or included use cases? (In the screenshot: Could AddProspectiveIngredient have a different primary actor than CreateRecipe? Same question for include)

EDIT: I don't think the question is asked broadly: If I use include or extend, will I have to use the same primary actors for those extending or included use cases?

I agree, as this was one of my first questions on Stackoverflow, that there is some unnecessary boilerplate in the beginning. If that is the case, I can edit my question to keep it open. I am still hoping for someone to stumble upon it and provide me with more knowledge or sources.

nst1nctz
  • 333
  • 3
  • 23

1 Answers1

1

If I use include or extend, will I have to use the same primary actors for those extending or included use cases?

Extend means that one Use case is a variation of another one. It is the definition, sorry. So, I am not sure you really meant it, but different variations of activity can be easily conducted by different actors.

As for include, it is not so simple. One behaviour is inserted in another one. It is some variation for generalizations for use cases.

So, if behaviour A includes B, and actor X is connected only to A and actor Y is connected only to B, that means, that Y really makes A, too, only not all of it. X has all behaviour of Y and some additional behaviour. And that means that X is derived from Y, or X is a subclass of Y.

Simply, if you have different not-tied actors for A and B, you have simply mistaken. They ARE tied.

enter image description here

Gangnus
  • 24,044
  • 16
  • 90
  • 149
  • Thanks again for your reply. In your example, does it mean that you could create an aggregated use case `AB` which has X as primary and Y as secondary actor? So, Y helps X to reach their goal and therefore to complete use case A. – nst1nctz Feb 23 '14 at 22:49
  • @user3025256 IMHO, both X and Y would work with AB and cooperate, but who of them is secondary, depends on the seeing of the client. X can do more things. But that doesn't mean he is always more important. What is primary and what is secondary has nothing to do with the model abstraction. It is only our evaluation by the scale of importance. This information helps to see the whole picture of the domain and its use, should be taken into account in our plans, but it is the information of the level HIGHER than the whole IT system. – Gangnus Feb 24 '14 at 08:57
  • I've just found the reason why I am confused about this issue. In a book we used at university, Object Oriented Systems Analysis and Design, Pearson International Edition, by Noushin and Hessam Ashrafi, this topic was addressed. "The primary actor of an extending use case must be the same as the primary actor of the base use case"(p. 226) But the book does not talk about this issue with include relationships. Is it wise to go by that rule? – nst1nctz Feb 25 '14 at 16:40
  • ok, your explanation about primary and secondary users of a use case AB makes sense to me. – nst1nctz Feb 25 '14 at 16:43
  • @user3025256 The standard of UML does not contain the terms 'primary actor' or 'secondary actor'. (Not 'user', please, actor can be non human). **OML** standard does know these two. (https://blogs.oracle.com/oum/entry/use_case_actors_primary_versus). Speaking on these, we are talking on practice, on some additional terms without the strict definition. Take another book, sometimes even of the same author, you'll see another def. of these sorts of actors. – Gangnus Feb 26 '14 at 08:43