USE case to Class Diagram - How do I?

前端 未结 4 1012
梦谈多话
梦谈多话 2021-01-31 00:13

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

4条回答
  •  眼角桃花
    2021-01-31 00:38

    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.

提交回复
热议问题