Analysis Models, Analytical Class Diagram II PB007 Software Engineering I Bruno Rossi 22. 10. 2014 aftware Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 1 / 16 Analysis Models The Analysis Model is a conceptual model that captures the abstraction of a problem in modeling the business domain. The use of design patterns can increase the flexibility and reusability of the model. In modelling, there are often a set of recurring problems. For example, the model for the organizational structure of a company can be used also with other similar types of hierarchies. Therefore, there are already some prepared patterns that can be used when modelling a software system. We just see here some of them. Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 2 / 16 Analysis Patterns - Martin Fowler Martin Fowler: Analysis Patterns - Reusable Object Models ► http://books.google.cz/books?id=4V8pZmpwmBYC&pg ► available at the library Fl, MZK ► different patterns according to the different domains Examples: Accountability, Observations and Measurements, Refering to Objects, Inventory and Accounting, Planning, Trading ► Each chapter contains several patterns that are then shown in use in some simple example and then also into more complex ones. ► Total of 65 analysis patterns and 21 auxiliary patterns Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 3 / 16 Analysis Patterns - Accountability - Party Telephone directory: 0..1 TelephoneNumber 0..1 8..* 0..* Person 0..* 0..1 Address 0..1 0.* Company 0.* 0. 1 EmailAddress 0..1 0..* Software Engineering I (PB007' Analytické vzory - Accountability - Party II Many of the roles that people play can also be derived from organizational units. Party/participant is an uniform name for these roles Person r L Company -[ -t> 0..1 TelephoneNumber 0..* Address Parly 0.* 0..1 0..* EmailAddress 0..1 Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 5 / 16 Analysis Models - Organization Hierarchies OperatingUnit 1 0..* Region 1 0..* Division 1 0..* SalesOffice ► inflexible - for addition/change of organizational units, it is necessary to change big part of the model ► small reusability - different companies can vary in organizational structure Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 6 / 16 Analysis Models - Organization Hierarchies II subsidiär/ Constr.: cann have a parent Organization pare [hierarchy] Constr.: parent must he a region And what if the company has a different type of organizational structures (e.g. Sales and Production) or when they change over, time? Software Engineering I (PB007) Analytical/Analysis Class Diagrams 7/16 Analysis Models - Organization Hierarchies III OrganizalionStructureType 1 0..* OrganizationStructure 0..* 1 TimePeriod o .• subsidiary 1 11* 1 parent Organization Analysis Models - Metaclass Pattern príchod datumPrilůtu, -casOdletu J T '"."r;' +ůtírůrJtRezervac ie[) ni za vnet Rezervaci oQ Obecne informácie o (pravidelnom) lete kotí +putvďit() +2TUSÍt{) Informácie pre rezervácie konkrétneho letu L Ľ L 1 'j k Ľ TypLůtu Lůt R Ľ i Ľ!'.-u Ľ il! -názov 1 ■■^iO^IC-Lu 23Lľt Odchodu -datu n' odctioíí q * ■caiPrüctu -ííatuniPrictmdu 1 1 -■Jon +ů tvořit Rezervacifl() 0..* +potvdjt() o..4 - +uzavriotRazeiv3cie{) +zrusit() f \ .*3 Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 9 / 16 Analysis Models - other resources ► http://martinfowler.com/articles.html Gamma, Helm, Johnson, Vlissides ("Gang of Four" - GoF): Design Patterns: Elements of Reusable Object-Oriented Software, 1991-1994 ► Buschmann, Meunier, Rohnert, Sommerland, Stal: Pattern -Oriented Software Architecture: A System of Patterns ► Lubor Šešera, Aleš Mičovský, Juraj Červeň: Datové modelování v příkladech Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 10 / 16 Relations between classes The basic relationships include: ► Generalization ► Association ► Dependency Association The Association is a relationship between classes. ► represents long-term relationships ► this type of reference is most often reflected in the presence of an attribute of the type of the other class ► relations 1:1 correspond to one reference attribute ► relations 1:N correspond generally to an array or collection ► the direction of the association (navigability) indicates the class that will contain the attribute Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 12 / 16 Association - Navigability The company has a relationship with more employees Firma 1 ^ zaměstnává Züir icsl nu i IUL" * The company contains a reference to a collection of employees, employed by. Employees do not have relation with company. Firms 1 ^ za mestnaiía > Zaměstnanec The company does not have a direct link to the staff. The employee has an attribute of type company as a reference. F i rnia 1 ^ za-iTW-stnava if Zuiriesriwi&e v. t Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 13 / 16 Dependency A dependency is a relationship between two classes (client and provider), where a change in provider may force a change in the client. In other words, the client somehow depends on the provider. The importance of this dependence may be specified by different stereotypes. The most often used stereotype is use. It indicates that some of the operations of the client object use the provider as an input argument or output. Klient Poskytovatel Poltit Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 14 / 16 Tasks ► Dokončite a rozpracujte diagram tried z minulého cvičenia ► The diagram should contain the analysis classes, attributes, operations and the different relationships (inheritance, association, dependencies) The associations should specify names, multiplicity a navigability ► Add manager classes that will take care of the lifecycle of other classes (maintaining a list of objects, the creation, the search, ...). Move the appropriate responsibilities/operation ► Update the Use Case diagram. For each class there should be a use case that creates instances, uses, and deletes instances of the class. ► Please review teh information about the analysis patterns and think about their use in your project ► Upload the pdf report on the folder (Week 06). Deadline: Mon, 27.10. 23:59 (Groups 10,11,12) |W Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 15 / 16 Configuration of PDF Reports 2^ Content ! t ■Options- p' Generate table of contents p Generate table of figures «■ Generate diagrams Image type : |SVG Page Setup Cover Page Header/Footer Document Info Watermark Details- J7 Children (* Model-based f Diagram-based _. I- Members r ERD Column Details H II a >/ Generate diagram type title Generate diagram properties Generate diagram summary \~ Include extra details Suppress element with blank documentation summary table v- Generate reference (file/URL) link !"" Generate mo'del elements/diagrams link Skip heading for empty model element section I- Convert multiline model heading to single line Show multiline model name I- Treat HTML content as HTML source Suppress details if duplicated v* Table cell keep together with page Wrap : ^Jword wrap |^^^[ Shape type style : Jkon T j RTF content appearance : JPreserve formatting H U H H | Properties !:i oiect manage msnl propertie Relationships J7 Quality information Anti-aliasing Unspecified ^ | ,,. | r References |~~ References documentation p1 Sub-diagrams I- Include sub-diagram details |~~ Comments Sort by Date/Time: [Descending ^ | |~~ Tagged values |~ ORM Class Details •S Use Case Details Reset to DeFault Software Engineering I (PB007) Analytical/Analysis Class Diagrams 22. 10. 2014 16 / 16