File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Extends/Includes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Extends/Includes" Watch "Extends/Includes" New topic


santoshkumar savadatti
Ranch Hand

Joined: Apr 27, 2010
Posts: 95
I'm creating requirements for a search tool.
The user searches for the product by entering search criteria.
Once search results are displayed, there are the following features:
Print Results, Send Results link via Email, Modify Search
Modify search allows User to modify the results by changing a criteria(radio button)

I'm a bit confused.

Is the relationship i have designed correct?

Also, should Print and Send link have "Includes" relationship with Search?
Marcin Majewski

Joined: Dec 20, 2010
Posts: 14

In my opinion all these use cases are part of "Perform Search" use case. This applies to "Modify Search" use case as well. However be aware that it is rather a theoretical consideration (with no impact on implementation as we're talking on a high abstraction level at this stage) and there are probably many arguments to reason the extends relation.

Check out my site at
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 384

i guess ... you are heading right ... include is used when you actually use some other functionality; in here extends works better as it is actually extending his own features
santoshkumar savadatti
Ranch Hand

Joined: Apr 27, 2010
Posts: 95
ty Lalit.
Marcin, some confusion. Hope you don't mind
In the approach that you suggested, Print Results, Send Results link via Email do not fit into either "Includes" or "Extends". Because, these are performed only after the perform search is executed.
Modify search on the other hand is an alternate route to regular search. Hence Extends is justified IMHO.
Are you suggesting that perform Search Use Case be abstract and modify search, Print results, send results have extends dependency with the abstract "Perform Search?"
In that case, i'm a bit confused coz there is no concrete Use Case to actually view Search results(Since it is part of perform search which is now abstract)

Marcin Majewski

Joined: Dec 20, 2010
Posts: 14

Thanks for your post santoshkumar savadatti. As we can see even a simple use case diagram can introduce confusion. It all depends on what we understand under "Perform Search" use case. If it's a bucket that can be divided into several use cases than I would use the <include> relation. If performing search is just a part of other use cases then <extends> relation is justified. However in either scenarion I don't understand how "Modify Search" can be inherited from "Perform Search" use case. I would rather change "Modify Search" into "Provide Search Criteria" or so, which is basically the same as search criteria modification and hereby the "Perform Search" includes "Provide Search Criteria" relation would be reasonable. Please let me know whot do yu think about that.
santoshkumar savadatti
Ranch Hand

Joined: Apr 27, 2010
Posts: 95
This is a nice conversation ;)
Modify Search is slightly misunderstood.
It is a specialized case different from normal search because , Modify search is available only after search results are displayed through regular search.
My fault.I should have been more clear.
So, once results are generated through regular search, User can modify the search criteria.

Consider this example:
User is searching for Condo in an area nearby.
In regular search (hypothetical), User specifies Zip Code and mmm...let's say his/her budget.
Now, search results are displayed.
Below, there is Modify search widget. The Modify search widget is a set of radio buttons. Each Radio button relates to a price range.
Hence, the User can now change his/her price range but not Zip Code. The Zip Code is still what was entered for regular search.
IMHO, this is a good case for "Extends" dependency.

And for "send results via Email" and "print" actions are optional. user who performs a search does not have to compulsorily send results or print them.
Whereas, "Includes" relationship requires that the action be performed "at least once" which means, the send results and Print actions would be compulsory.

That's what i know or i think i know

Sorry for the ambiguity in my previous posting.
I agree. Here's the link:
subject: Extends/Includes
It's not a secret anymore!