What does a class diagram contain?

7

The title is a stupid question, because the name of the diagram already responds. But yesterday this question came to my head when a professor of Analysis and Software Projects asked the whole class the class diagram of what would be our project to conclude the period.

So far so good, it would just be one more in the myriad of diagrams we make in colleges today, and so he made a somewhat unpossessing setting to be held at least on my part. In addition to the basic classes, we should also include the business rules, interfaces, façades, DAO classes, and the main my controllers (system is web and developed with JSF, it would be the Bean ).

Is that right? I mean, is not it common to see a diagram like this, does it really exist?

    
asked by anonymous 20.10.2016 / 14:27

2 answers

6

Actually, I think it depends. There are several types of class diagram.

Conceptual:

Represents in a somewhat more abstract way, not necessarily referring to the final implementation.

Example:

Specification:Perspectiveaimedatthosewhoneedtoknowtherulesofthesystembutnotitsimplementation(suchasprojectmanager)Soitfocusesonthemainmethodsofthesystem.

Example:

Implementation(Themostused,andprobablywhatyourteacherwants):Ithasallthesystemclassesandtheirmethods,attributes,interfacesandeverythingrelatedtoimplementation.Aimedatthedevelopmentteam,withallthedetailsneededtoimplementthesystem.

Example:

This does not mean that if the need arises, these diagrams can not be changed to include a new method or class that was not initially specified.

Reference: >

    
20.10.2016 / 14:54
4

The class diagram lists the concepts that will be implemented in the systems and their relationships. It is a consequence of requirements gathering, case definition of uses and classes. The great importance of the diagram is that it defines the structure of the system.

This example, taken from the Macoratti site, shows the basic steps involved in creating the diagram:

  
  • Survey and analysis of system requirements to be developed. Interview with the dentist (s) and the people working at the   office
  •   
  • Definition of system objects: Patient, agenda, dentist, service, contract, query, payment, etc.
  •   
  • Definition of system actors: patient, dentist, secretary
  •   
  • Definition and detailing of use cases: mark consultation, confirm consultation, register patient, register services, etc.
  •   
  • Class definition: patient, dentist, exam, schedule, service
  •   
  • Define class attributes and methods:
  •   

After all this analysis you arrive at the system class diagram:   

Youcanreadmoreaboutclassdiagrams:

20.10.2016 / 15:08