UML use case diagram "cafeteria system" validation - uml

I've written a script to make a cafeteria system at college. I need to know whether my diagram is correct, especially the shares of the operations.
The student selects one of the restaurants available in the cafeteria.
The student selects the item you want with the possibility of adding some ingredients to the item and receive the sellers.
The student pays to the seller. The delivery of a request is included, an update to the store at the moment the student is paid.
The seller's issue the invoice to the student and includes an addition to the account of exports and imports of the restaurant.
Administrator for the restaurant When you want to add new item, the sellers are notified of the new item added.
Administrator records attendance and absence of sellers.

Use correct naming for use cases: predicate, subject (, object).
Do not use include/extend as it's simply mistaken for functional decomposition, which is plain wrong.
Synthesize function descriptions to extract the added value hidden behind those descriptions and make them use cases (single added values the system under consideration delivers to its actors).
It's ok to indicate primary and secondary actors by using directed associations. However, this in no standard, but a convention and needs to be explained in separate modeling rules.
Your saller should likely be Seller. Note the upper case first char too (also wrong with Student).
With little effort your diagram could have been uncluttered!

Related

Modeling UML Use Case Diagram for Library Online Management System

I have a list of functionality that the system should have and I have created a case diagram for it, but I am not sure if it correspond to said functionality and want a second look on my solution. Hopefully it is readable and I appreciate any feedback on my trail of design.
Description of said functions:
The system shall allow people to register as a student or faculty member. To sign up, users must provide their name, e-mail address, phone number, and a password. In addition, students add the name of their program and their student id; faculty members add the name of their department and their employee id.
A user shall be able to search for books, the library system shall indicate the availability for books. If available for loan, a logged in user shall be able to reserve a book for loan. When reserved, the librarian will move the book to a pick-up shelf. To loan a book, users shall login at the library in person, and checkout the books.
The library has an automated booth where users can leave the books and the system shall process the return, upon return, the system shall send a digital receipt sent to their e-mail address.
When a book is not returned in time, the system shall send a reminder e-mail with a fine for each day it is late.
The system shall allow users to extend the loan period of a loaned book at most two times. The system shall allow users to have at most five books on loan simultaneously. If a book is not available in current library, but is in another one, users can ask the system to transfer and vice versa. Books have a title, author, ISBN, edition, and shelf number denoting their location in the library. The library has varying stock for different books, it has a single copy for most books but up to ten physical copies for some popular books.
Librarians shall be able to add new books to the system and edit the information of existing books.
The design :
Update based on feedback:
I will not make a detailed review of your diagram, since this is very specific to your needs and will not help anybody else. However, I'd like to address some general issues that are frequent in these kind of diagrams:
It appears in the requirements that users may be a student or faculty member (or both?), whereas your diagram suggest that a user is another independent category of actors.
Having several actors for a use case is ambiguous. It cannot always be avoided, but here, it's not clear if all the actors are involved at the same time for a search, or if they are involved one after the other, or if only one may be involved at a time.
Your diagram is a functional decomposition of the requirements. For example, Register and Verify registry are not independent, but the second belongs to the detailed decomposition of the first, without being an independent user goal (in fact, the verification doesn't make sense without the first). The same applies to all the verifications ("maximum...") as well. This is not forbidden but strongly discouraged as it leads to too detailed and complex diagrams.
Sometimes your diagram seems to be a sequence of action: e.g. Return a book is followed by a confirmation email. Use-case diagrams shall not show any sequence. If you want to show the workflow, you need to use an activity diagram and not a use-case diagram.
extend corresponds to an optional use-case. Here, you seem to say that books are returned only for some loans.
In conclusion, simplify your diagram to show only user goals. Avoid extend and include dependencies as much as possible, to keep it simple and understandable. If you want to document details, document them in a narrative, not in the diagram.
To boil it down: this is no use case synthesis but functional decomposition. Use cases show added value for actors. Full stop. This is obviously the hardest thing to learn when finding use cases. They are like pearls you have to find. It's not about the how-to.
I recommend reading Bittner/Spence about use cases.

Correct usage of includes and extends in use case diagram

I am creating a use case diagram for a barber shop system. I am not sure if the Add Product Inventory use case should include the Purchase Product use case.
The actors which will interact with the barber shop system are:
Customers
System users (ie. Barber)
System Administrator (ie. Manager)
All users will need to be able to login in, customers will need to register if they are a first time user.
The customer will interact with the system to make a booking or purchase a product i.e gel, shampoo, wax. A booking can extend to cancelling the appointment, it is unlikely for the customer to be able to reschedule the appointment but rather cancel the appointment and book again at a different time.
The system user, the barbers, need to be able to view the timetable of appointments, view customer contact details and login to the system.
The system admin, who is likely a manager and head barber, should also be able to view the timetable of appointments, view customer contact details and add a product inventory to the store. The product inventory will also include setting product specification, the colour or size of product, and setting the price.
I am not sure if the Add Product Inventory use case should include the Purchase Product use case.
This is not the case, else that means each time a product is added in the inventory it is also purchased during that add. Note also the actors are not the same for these two use cases, but having the include that means the purchase is also done by the admin.
There is no extend too.
The fact a product was added in the inventory before to be purchased is a precondition you put in the description of the UC Purchase.
There are other problems in your diagram :
all your extends are drawn in the wrong direction, except may be between Login and Register depending on what you wanted to say
it is common to put the secondary actors on the right, so Customer seems to be a secondary actor but this is not the case.
Admin and Barber cannot Login (but they can logout), to have one of these roles a real person needed to successfully login before and that is done with an actor Guest or something like that.
in the same way a Customer cannot Register (nor Login)
But in fact Login and Register (and logout) are very common and simple features and probably do not have enough plus value to be use cases.
A Customer can cancel an appointment only during its creation, this is not what you want.
you need to allow Customer to activate Cancel Appointment in an other way (directly or as an extension of the probable View Own Appointments, see after)
for me while an appointment is under construction it does not exist and then the Customer cannot cancel the appointment, but the customer can abort the construction. So for me there is no extend between these use cases. Of course in the description of Make Appointment you can say an abort is possible, but I think this is the case in all the UC.
Very probably a Customer can view his/her appointments so an UC (let say View Own appointments) must be added. Note this is not like the UC View Appointmenst a Barber can activate, so these UCs must not have the same name. To have Cancel Appointment as an extend of this new UC seems a good way and in that case Cancel Appointment cannot be directly activated by Customer.
Some UCs an Admin can activate are missing, to modify the price of a product, to remove a product, to modify a barber details, to remove a barber, ...
I'm not familiar with the business rules in your scenario, so this is a little bit of guess-work and a few assumptions which you can verify.
I assume the 'Add Product Inventory' Use Case is about adding products to an inventory of all products. For our purposes to answer your question, I don't think it matters whether this Use Case relates to adding one product, multiple products, managing products (e.g. editing or removing them), whether the inventory already exists or not, or if the Inventory is a separate thing to the Products on it, but answers to those questions are not 100% clear from your model and you may consider clarifying those points.
I also assume that a Product needs to be on the Inventory in order that it can be Purchased. If that is the case, then I think what you are asking is about this very point -- how do I represent the fact that the Product needs to be Added to the Inventory before it can be Purchased? If that is what you're asking, then you can represent that using a simple 'dependency' relationship which would run from the Purchase Product Use Case to the Add Product Inventory Use Case as per below. This states that the Product Purchase is somehow dependent on Add Product, but does not go further in explaining that relationship. Alternatively, you could use a preceedes relationship running instead from the Add to the Purchase. I don't think extend is the correct relationship -- the steps of Add Product don't need to be factored in every time you Purchase Product, the dependency is on the objective of Add Product having first been achieved, not the steps.

Class diagram for a mini JEE project

I want to start a project in JEE and I need to confirm about my class diagram. I need to know if the methods used are correct and if the composition I used is correct or not.
This is my class diagram:
The project is about an online sales store, that wants to set up a management tool to sell products, and to manage its products. This tool must include the following features:
Identification module: identification of clients, managers, supervisors
Sales module: make purchases for users
Product Management Module: Adding / Deleting Products
Statistical module: visualization of sales statistics
Functional Specifications
It is necessary to act on the application, to connect to the application with a user ID and password. To facilitate its use and in order to avoid any mishandling thereafter, here is the solution:
User Profile:
The user will be able to visualize the products sold by My Online Races. The user can place an order, provided that he has registered with the site My Online Races.
Manager profile:
The manager will be able to manage the products:
Add / Edit / Delete Products
Add / Edit / Delete category
These data insertions can be made using CSV or XML files, but also through various forms on the website.
The manager will be able to view the sales statistics.
Supervisor Profile:
The supervisor can add managers whose roles are specified above.
The supervisor will be able to view the sales statistics.
The supervisor will be able to view all the actions performed by the managers, a sort of audit trail.
Well I wish to know already if you have remarks about my design. As well as I have a confusion for several methods, for example adding, modifying and deleting a product. Should I put them in the manager or product class? Is the composition I put correct or should I remove it?
Quick review of the diagram and advices
First some minor remarks about class naming: Ordered should be called Order.
The composition between Article and Order is just wrong (not from a formal view, but from the meaning it conveys). Use a normal one-to-many association: it would reflect much better the real nature of the relation between the two classes. Please take into account that a new article may exist without having been ordered, so it shoud be 0..* instead of 1..*
+belongs and +do in the middle of an association are syntactically incorect. You should use a plain triangle instead (or nothing at all). The triangle should be oriented in the reading direction Person do |> Order and Article belongs to |> Category
The methods seem ok. You do not need to add a suffix.
How shall objects be managed (created/updated/deleted) ?
A more advanced concern is not about the diagram but about how you want to organise persistence (i.e. database storage):
do you really want the object to be an active record, that is an object that adds, updates and deletes itself (to the database) ? It's simple to set up, works well, but makes the class dependent on the underlying database implementation and thus makes maintenance more difficult;
or wouldn't it be better to use a repository for each object ? In this case the repository acts as a collection that manages all the database operations. The domain object (Article, order, User, ...) then have nothing to know about the database, wich leads to more maintainable code.
But this is a broader architectural question. If it's just for a first experimental project with JEE, you can very well use the active records. It's simpler to set up. Be sure however in this case to disambiguate the Add/Update/Delete on Person, since it currently may give the impression that any person can add anyone.
Improvement of the model
A final remark, again not about the diagram itself, is about the domain. Your model considers that an Order is about a single Article.
In reality however, orders are in general about one or several articles: if this would also be the case here, your Order would become an OrderItem and the real Order would be inserted between Person and OrderItem. You could then make the relation between Order and OrderItem a composition (i.e: OrderItem is owned by Order, which has responsibility for creating its items, and the items have no sense without the related order).

UML: Use Case Diagram

I need to create USE Case for the following component.
Manage Consultant
Use cases--add consultant, update consultant, add speciality, update speciality Consultants and specialities are either active or inactive.
Speciality is a stand alone class
Speciality is also part of Consultant class
2nd Component
Confirm appointment--consultant views appointments and confirms times. Firm appointment is saved and customer gets email confirming time.
Confirm Invoice--consultant views invoices and, if an invoice has been paid, marks as paid.
Am I right?
From my understanding USE Case does not show the detailed list steps with in the USE Case. So mark paid you don't don't ned to be shown.
For your first diagram: do not use generalization with UCs. Each UC represents a unique single added value for the actor. If there were such a thing as a generalized added value that would never be unique. Remember: there's just a unique selling point, never a general one. Just remove the Manage-UCs and connect the "real ones" directly.
Your 2nd diagram looks fine to me.

UML assignment question

Sorry, I know this is a very lame question to ask and not of any use to anyone else. I have an assignment in UML due tomorrow and I don't even know the basics (all-nighter ahead!). I'm not looking for a walkthrough, I simply want your opinion on something. The assignment is as follows (you only need to skim over it!):
=============
Gourmet Surprise (GS) is a small catering firm with five employees. During a typical weekend, GS caters fifteen events with twenty to fifty people each. The business has grown rapidly over the past year and the owner wants to install a new computer system for managing the ordering and buying process. GS has a set of ten standard menus. When potential customers call, the receptionist describes the menus to them. If the customer decides to book an event (dinner, lunch, picnic, finger food etc.), the receptionist records the customer information (e.g., name, address, phone number, etc.) and the information about the event (e.g., place, date, time, which one of the standard menus, total price) on a contract. The customer is then faxed a copy of the contract and must sign and return it along with a deposit (often a credit card or by check) before the event is officially booked. The remaining money is collected when the catering is delivered. Sometimes, the customer wants something special (e.g., birthday cake). In this case, the receptionist takes the information and gives it to the owner who determines the cost; the receptionist then calls the customer back with the price information. Sometimes the customer accepts the price, other times, the customer requests some changes that have to go back to the owner for a new cost estimate. Each week, the owner looks through the events scheduled for that weekend and orders the supplies (e.g., plates) and food (e.g., bread, chicken) needed to make them. The owner would like to use the system for marketing as well. It should be able to track how customers learned about GS, and identify repeat customers, so that GS can mail special offers to them. The owner also wants to track the events on which GS sent a contract, but the customer never signed the contract and actually booked a GS.
Exercise:
Create an activity diagram and a use case model (complete with a set of detail use case descriptions) for the above system. Produce an initial domain model (class diagram) based on these descriptions.
Elaborate the use cases into sequence diagrams, and include any state diagrams necessary. Finally use the information from these dynamic models to expand the domain model into a full application model.
=============
In your opinion, do you think this question is asking me to come up with a package for an online ordering system to replace the system described above, or to create UML diagrams that facilitate the existing telephone-based system?
Create an activity diagram and a use case model (complete with a set of detail use case descriptions) for the above system.
I think it's right there in the text: they want you to document the system described.
Best of luck!

Resources