27. Aspect-Oriented Design (Aspektorientierte Decomposition)
Total Page:16
File Type:pdf, Size:1020Kb
Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie 27. Aspect-Oriented Design (Aspektorientierte Decomposition) Prof. Dr. Uwe Aßmann $* +spect-oriented Technische Universität Dresden decomposition Institut für Software- und "* The Modularity -aw of Multimediatechnik +spect Separation http://st.inf.tu-dresden de .* /ssential Decomposition /teaching/swt" 0* +spect-oriented e1tension #ersion $%-0 '( $) &$ $) Prof. Aßmann - Model-Driven Software Development (MDSD) © Prof. U. Aßmann 2 Obligatory Literature Obligatory ► ► Model-Driven Software Development in Technical Technical Spaces (MOST) Development in Software Model-Driven Software, 12 (6), Nov. 1995, IEEE, S. 42-50 IEEE, S. 1995, Nov. 12(6), Software, IEEE 4+1 Architecture; The Modelof C.: View B., Vancouver, P., Kruchten, [Kruchten] (Wikipedia) models View – – – http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=469759 a view model a we call chapter, this In http://en.wikipedia.org/wiki/View_model specifc perspective models perspective specifc perspective model. perspective Here, view modelsare view Here, © Prof. U. Aßmann 3 ► ► ► ► Other Literature Other Model-Driven Software Development in Technical Technical Spaces (MOST) Development in Software Model-Driven 2004 2004,Berlin 2004.Heidelberg LNCS3063,35–51, pp. Springer-Verlag Ada-Europe Llamos A. Middleware.In: Anof Overview Vinoski. Steve A.(Eds.): Strohmeier and ́ı 1992) München (2.Auf.) Verlag Hanser Methoden; mit Strukturierten Systementwicklung J.: Raasch, [Raasch] 1988 Verlag Hanser Systemanalyse; Strukturierte J.: S.,Palmer, McMenamin, Design” Kapitel auch “Action-Oriented Siehe 1978/1979. Inc. Yourdon Specifcation; andSystem Analysis Structured T.: Marco, De © Prof. U. Aßmann 4 ► ► Goal Model-Driven Software Development in Technical Technical Spaces (MOST) Development in Software Model-Driven Understand the modularity law of aspect separation of law aspect modularity the Understand oriented) aspect- (crosscutting, for strategy decomposition different acompletely about Learn Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie 27.1 Aspect-Oriented Decomposition Prof. Aßmann - Model-Driven Software Development (MDSD) Development with Different Decomposition Strategies 6 Model-Driven Software Development in Technical Spaces (MOST) ► So far, we had modular decomposition strategies, who decompose with regard to one decomposition criterion for stepwise refnement (divide&conquer-based decomposition): – Function--oriented Decomposition – Action-oriented Decomposition – ECA-based Decomposition – Data-oriented Decomposition – Object-oriented Decomposition – Component-oriented Decomposition – Transformative Decomposition Concern-oriented (Aspect-oriented) Development decomposes into several perspectives simultaneously n n a m ß A . U . f o r P © Perspective Models, Viewpoints and Views 7 Model-Driven Software Development in Technical Spaces (MOST) ► A component space (system-, artefact- or solution space) consists of a set of model and program components – With one or several software systems ► A concern (Belang) forms a simple viewpoint on this component space ► A concern space (aspect space, Belangraum, Aspektraum) consists of a set of concerns and an algebraic structure ► A separation-of-concerns space (SoC-Space, Sichtenbildungsraum) consists of a coupled concern and component space. It serves for the construction of simpler views on the component space. The concern space is used as an index. ► A perspective (viewpoint) consists of a set of concerns relevant to an actor ► A perspective model (viewpoint model, view model) defnes a SoC space anf forms the backbone for systematic aspect-oriented development n n Examples: 4+1 views of Kruchten, RM-ODP, Zachmann framework, MDA a m ß A . U . f o r P © © Prof. U. Aßmann 8 Actors, Concerns, and Perspectives and Concerns, Actors, Actor ► Model-Driven Software Development in Technical Technical Spaces (MOST) Development in Software Model-Driven A perspective groups concerns on behalf of the eyes of an actor. of an eyes of the behalf on groupsconcerns A perspective Actor Perspective Q Perspective P Concernraum Concern 3 Concern Concern 2 Concern Concern 1 Concern Concerns and Blood Groups for Software and Documents 9 Model-Driven Software Development in Technical Spaces (MOST) ► Concerns are colors or bloodgroups of components. Concerns group a software system(s) into a SoC space (Sichtenbildungsraum) with – Concern space (Belangraum) with concerns (Aspekt, Belang, Farbe, Bloodgroup), grouped into Perspectives (viewpoints) – Component space (Solution space) with the components of the software system(s) – Concern mapping defning views (Sichten, slices, Scheiben, Schicht) in the component space, correlated to a concern or a perspective Concern Space Component Space (Aspektraum) (Solution Space) Concern 1 Perspective P Concern mapping (Sichtenabbildung) Concern 2 n n Perspectivea Q m ß A . U . f o r Aspekt 3 P © Concerns and Blood Groups for Software and Documents 10 Model-Driven Software Development in Technical Spaces (MOST) ► Concerns and views together are called the aspects of the software or the document ■ Example: layout aspect, structural aspect, behavioral aspect Concern Space Component Space (Aspektraum) (Solution Space) Concern 1 Perspective P Concern mapping (Sichtenabbildung) Concern 2 n n Perspectivea Q m ß A . U . f o r Aspekt 3 P © Well-known Examples for Aspect Separation 11 Model-Driven Software Development in Technical Spaces (MOST) Several technologies owe their success to aspect-oriented decomposition strategies: ► 1) Document Decomposition into Aspects Structure, Layout, Behavior Structure: described in html or XML Layout: specifed in CSS or FO Behavior: event-condition-action-based reaction: e.g. in javascript or PHP Concern space Component space Concern 1 Structure html Perspective P css (static aspects) Concern 2 Concern mapping html Layout n n a m Perspective Q css ß A . (entire web site) U . f o r Concern 3 P © Reaction javascript Other AO-Decomposition Strategies are Aspect-Oriented 12 Model-Driven Software Development in Technical Spaces (MOST) 2) Architectural Decomposition decomposes a system into the aspects Architecture and Application (see ST-1 and CBSE) 3) Bloodgroup Decomposition (A-T-0, Siedersleben) Application (A), Technique (T), Algorithmic (0) Concern space Component space Concern 1 workflow spec Architecture Perspective 1 Java (architecture) Concern 2 Concern mapping workflow spec Application n Java n Perspective 2 a Concern 3 m ß (blood groups) A Technology . C U . f o r P © Concern 4 Java Algorithms Other AO-Decomposition Strategies are Aspect-Oriented 13 Model-Driven Software Development in Technical Spaces (MOST) 4) Essential Decomposition (EAI-Decomposition) (from Structured Analysis) distinguishes the following aspects (viewpoints): – E: Essential activities, data structures and their stores – A: Administrative activities (for the check of data consistency and contract checking) – I: Infrastructure activities (for communication and adaptation to plattform) 5) Platform-oriented Decomposition decomposes into the aspects (see chapter “MDA”): Essential activities Adaptation to Platform 1 .... Plattform n n n a m ß A . U . f o r P © Perspectives (Viewpoints) 14 Model-Driven Software Development in Technical Spaces (MOST) ► A perspective (viewpoint) consists of a set of concerns (aspects) ► A simple Perspective consists of one concern ► A view of a perspective consists of all views related to the concerns of the perspective Concerns Views Concern 1 Perspective 1 Concern 2 n n a m ß A . U . f o r P Perspective 2 Concern 3 © © Prof. U. Aßmann 15 ► ► ► Perspective Models (Viewpoint Models) (Viewpoint Models Perspective Model-Driven Software Development in Technical Technical Spaces (MOST) Development in Software Model-Driven Example: RM-ODP defnes 5 viewpoints on a IT infrastructure on aIT RM-ODP defnes5viewpoints Example: by of asystem aspectseparation the itdefnes Thus, onsystem(s). the andviews concerns A http://en.wikipedia.org/wiki/File:RM-ODP_viewpoints.jpg perspective model defnes a standard set of perspectives (viewpoints) with their (viewpoints)with perspectives of set defnes astandard http://en.wikipedia.org/wiki/View_model sets of concerns Architectural Aspects of Kruchten The Perspective model of [Kruchten] „4+1 View Model of Architecture” 16 Model-Driven Software Development in Technical Spaces (MOST) ► The 4+1 Perspective Model defnes 2 perspectives for all components of a system(s), for design, program and runtime – Perspective 1: 4 aspects: Concerns and views – Perspective 2: 1 aspect: Szenarios Shows the development Shows an archtiectural view structure of the f iles, on the functions and components models, and code Logic Development View View Szenarios Implementation View of distribution and runtime coordination view n n a m ß Use cases show how A . Process- Physical U . views work together f o r View View P © © Prof. U. Aßmann 17 http://en.wikipedia.org/wiki/Zachman_Framework Perspective Model „Zachmann Framework“ „Zachmann Model Perspective ► Model-Driven Software Development in Technical Technical Spaces (MOST) Development in Software Model-Driven all activities of the software life cycle into views into life cycle software of the activities all to group and6 questions 5concerns of out aspectspace amatrix proposed Zachmann Fakultät Informatik - Institut Software- und Multimediatechnik - Softwaretechnologie 27.2. The Modularity Law of Aspect Separation