How To Make A Use Case Diagram With Visual Studio For Mac

Active3 years, 8 months ago

I would like your guidance on how to create classes and their relationships (generalization, association, aggregation and composition) accurately from my USE case diagram (please see below).

I am trying to create this class diagram so I can use it to create a simple online PHP application that allows the user to register an account, login and logout, and store, search and retrieve data from a MySQL database.

Are my classes correct? Or should I create more classes? And if so, what classes are missing? What relationships should I use when connecting the register, login, logout, search_database and add_to_database to the users?

Scoop.it; yUML is an online tool for creating and publishing simple UML diagrams. You can use yUML to make UML diagrams and then copy and paste to your MS PowerPoint slides. This way, software architects or developers can enjoy a simple tool for software development, analysis and design using common tools and popular like PowerPoint. You can create UML class, sequence, component, use case, and activity diagrams in Visual Studio 2010 Ultimate. You can link these diagrams to Team Foundation work items so you can plan and track development and test work.

I'm new to design patterns and UML class diagrams but from my understanding, the association relationship relates one object with another object; the aggregation relationship is a special kind of association that allows 'a part' to belong to more than one 'whole' (e.g. a credit card and its PIN - the PIN class can also be used in a debit card class); and a composition relationship is a special form of aggregation that allows each part to belong to only one whole at a time.

I feel like I have left out some classes or something because I just can't seem to find the relationships from my understanding of relationships.

Any assistance will be really appreciated. Thanks in advance.

USE CASE DIAGRAM

Case

USE case explanation:

RegisterAny users can create an account by registering. The system will validate the user name and password and will reject them if either they are missing or if the user name is already taken.

LoginAny users can login only if they have already registered. Their user name and password will be validated in the same manner as when registering an account.

Search DatabaseAny users will beable to input a searchkey of datatype string and the system will open the database, search for the searchkey, and return true or false depending on whether or not the searchkey was found, and close the database.

Add data to databaseAll users will be able to input some data, the system will open the database, store the data, return true or false depending on whether or not the data was stored, and close the database.

LogoutThe user will press the logout button, and the system will logout the user

Delete from databaseOnly the administrator can delete data from the database.

Delete regular usersOnly the administrator can delete a regular user

CLASS DIAGRAM

SuperBiasedMan
7,4348 gold badges33 silver badges58 bronze badges
AnthonyAnthony
1,67119 gold badges58 silver badges91 bronze badges

4 Answers

First, if you're determined to go down a modeling path, then I'd recommend a book by Rosenberg and Stephens, Use Case Driven Object Modeling with UML. This goes through a process exactly what you're describing: how to write good use cases, build class diagrams from them, build sequence diagrams from that, and (ta-da!) code it up into working software. You might be able to Google for the ICONIX process and find details online.

Some casual comments:

  • The 'diagram' of any Use Case Diagram is the least useful aspect of use cases. Every oval on the diagram represents a paragraph or two of text telling the story of what's going on. It's that text that's really helpful.
  • Usually you have classes for the nouns in your use cases, and methods for the verbs. Some of your verbs (Add_data_to_database, Logout, ...) are classes instead of methods.
    • Sometimes you get this sort of thing if you use a framework that encourages a command pattern. Even then, the command objects can/should just invoke methods on your real classes.
    • I would say you're missing some nouns (what type of data are your storing in the database?). If you had that, then you would find relationships between User's and those data classes.
leedm777leedm777
17k8 gold badges50 silver badges80 bronze badges

It seems that there's no problem with the UC diagram.

I agree with the comment from Dave. Beside, i also want to show you my idea to make corresponding class diagram for such a UC diagram. (Just the main point shown.)

Nathan Tuggy

How To Create A Use Case Diagram

2,2049 gold badges25 silver badges35 bronze badges
TinTin
Sequence diagram

Why not download EssWork. Esswork is opensource and it is agile practicebased, made by Ivar Jacobson Int, the guy who created Use cases... their is a practice in there called Essential Use case practice, it describes how you take a requirement down to classes...

ZyberITZyberIT

You are required to draw an Object Model (Class Diagram) of the above scenario byidentifying classes, its attributes and related functions.
You should have to show the relationship among differentclasses like Composition, Aggregation and Inheritance.

Class Diagram

bummi
25.5k8 gold badges53 silver badges92 bronze badges
bc130402604 Ghulam Muhammadbc130402604 Ghulam Muhammad

Use Case Diagram Examples

Not the answer you're looking for? Browse other questions tagged design-patternsoopclass-designuml or ask your own question.