Why do we use UseCase diagrams in OO analysis and design, even if Usecases are not considered OO?

UML notation says that Usecases are drawn to indicate functional requirements in the Problem Domain, it does not in any way give information about an object or class like Flow Diagram Data or Entity Link Diagrams. But why do we use Usecase diagrams in OO analysis and design, even if Usecases are not considered to be OO.

+4


source to share


4 answers


The usage diagram is intended to shed light on the basic functionality of the system and highlight the perspective presenting the latter as a black beans simply existing for a single mission, to deliver the Promised Service to the actor.

We don't really care about OOP at this point, as you can definitely use a use case diagram for any other type of analysis.



UML is just a set of visual tools that allow a unified expression of different perspectives of a system. In case you are using a Unified Process , it first starts by identifying use cases and then blasts each use case in co-co-located entities (classes) and establishes static collaboration between them using Class Diagram .

+4


source


Object oriented analysis and design methodology, while usage is requirements methodology. And stay on top of the main development process:

  • Business modeling
  • Requirements
  • Analysis
  • Design

If we use UML to do this work, we can have:



  • Business Case Study + Business Sequence Diagram
  • System case + System use case
  • Analysis Class Diagram + Analysis Sequence Diagram + State Machine State Diagram
  • Code, database ...

UML diagrams in 3.can be replaced with DFD / ER

+2


source


Kirill Fakhrutdinov online book uml-diagrams.org defines UML as

The Unified Modeling Language ™ ( UML® ) is a standard visual modeling language designed to be used

  • modeling of business processes and similar processes,
  • analysis, design and implementation of software systems

UML is a common language for business analysts, software architects and developers, used to describe, describe, design and document existing or new business processes, structure and behavior of software system artifacts ....

As such, the language needs words to describe the processes, their participants (the code and its users, why the code exists, what is it good for, why should someone pay money for it ..) ..

If in your projects you do not need to consider users and their needs (you have a user interface design, and you only focus on library code), then do not worry, use UML to describe the parts you are dealing with and use diagrams that are natural and useful to you (and your teammates)

Some related articles:

+1


source


If use case diagrams are mainly for communicating with non-technical people, I would like to add that in some software architectures (such as Clean Architecture) use cases are represented as real objects that manipulate objects (they are equal to services after everything). For example. Given the Submit Question use case, you can create the following definition for it:

Send a question Use case

Input data:

  • ISSUE_ID
  • issue_description
  • date

Output:

  • same input as for confirmation

Main course

  • Check input

  • Create a new Issue instance using input

  • Save new issue

  • return confirmation data

As you can see in the main course, there is even a detectable dependency between this use case and an entity named "Issue".

Python example for this UseIssue Use Case class:

class SubmitIssue(UseCase):

    def __init__(issue_repo):
        self._repo = issue_repo

    def execute(self, input_data):
        #validate input data as needed
        #and apply branching logic if it is valid
        new_issue = Issue(input_data) #create new issue
        self._repo.add(new_issue) #persist new issue
        return self._generate_output_data(new_issue)

    @staticmethod
    def _generate_output_data(new_issue):
        #logic that returns the output data as specified
        #in the use case output data definition
        return output_data

      

Sincerely.

0


source







All Articles