Seminar on Design and Architecture Patterns
Ošlejšek
Lesson details
- Teams update their models (composite, strategy, and builder patterns) under the supervision of the tutor. The tutor again explains the details of one pattern (see below) and waits/consults until all teams finish their models correctly.
- In the meantime (or later) each team member studies one additional design pattern (different from other team members). Recommended patterns to study are (but other patterns can be selected as well): Adapter, Abstract Factory, and Observer.
- If there is a time at the end of the lesson, then the tutor explains the three patterns briefly.
- Teams propose the application of the new three patterns by updating the previous document.
Instructions
Strategy
- <<strategy>> class associates SW metrics to be applied.
- <<strategy>> class has to have a method that takes a file, applies SW metrics, and stores the result in a report.
- <<context>> is the Project class.
- <<context>> aggregates (not associates) three strategies (optional, basic, periodic). Pay attention to correct multiplicity.
- <<context>> has to have two kinds of methods: for setting a strategy and for metric application which uses the strategy. Using the strategy means, that the method takes the root of the project's source code hierarchies (of a given version) and applies SW metrics to it recursively (see below).
Builder
- <<product>> is the <<strategy>> class.
- <<builder>> is a (new) class enabling us to add a metric, remove matric, set/change dependences (metric A is applied only if metric B succeeded), etc.
- <<director>> is a class that enables us to build the strategy (QoS configuration) interactively in the GUI, by reading a JSON file (predefined configurations), etc. Which class should have this responsibility?
Composite
- There should be an auto-propagating method that takes metrics to be measured and traverses the three. Leaves (files) provide their content to the metrics and then the analysis is applied.
- There are multiple types of files (leaves), but only a few of them are relevant for SW quality. For example, README.txt should not be analyzed. Therefore, we have to distinguish between multiple leaves (introduce their sub-classes).
- The root is a special composite node that will probably have many special attributes and/or associations with other classes. Therefore, it should be also specialized in the composite structure.
Schedule and deadlines
- Until Wed. 9.11., noon, each team updates the proposal of using another three design patterns.
- Note: There will be no mutual review this time.
- Until the end of the week, the tutor will send an e-mail with instructions (which patterns and how to apply them)
- On Mon. 14.11. the lesson IS CANCELED
- Until Fri. 18.11., 6:00, each team submits an updated class diagram (VP report) with new three patterns applied.
- Until Fri. 18.11., 6:00, each team a sequence diagram capturing the creation of a basic analysis and its assignment to the project (the sequence diagram of the application of the basic analysis on a source code is optional but welcome ;-)
Chyba: Odkazovaný objekt neexistuje nebo nemáte právo jej číst.
https://is.muni.cz/el/fi/podzim2022/PV167/um/design/DesignPatterns/hires/contfso.htm