conceptual architecture - ktikti.tugraz.at/staff/rkern/courses/sa/slides_ca.pdf · ticket download...
TRANSCRIPT
Conceptual ArchitectureSo�ware Architecture VO (706.706)
Roman Kern
Institute for Interactive Systems and Data Science, TU Graz
2018-10-24
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 1 / 53
Outline
1 Definition
2 Designing Conceptual Architecture
3 Behaviour Model
4 Component Stereotypes
5 Design Guidelines
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 2 / 53
DefinitionWhat is conceptual architecture?
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 3 / 53
Conceptual Architecture
Focuses on domain-level responsibilitiesInitial architectural design
First response to stakeholder needs
Design by analysing requirements
Contains components and connectors (box-and-line)
→ Provides an at a glance overview of the structure of a system in terms of its functionality
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 4 / 53
Components in conceptual architecture
ComponentsSet of related domain-level responsibilities
Initially, responsibilities arise from functional requirementsHowever, design is an iterative process
Further iterations take into account non-functional requirements
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 5 / 53
Connectors in conceptual architecture
ConnectorsConnectors indicate that connected components exchange information
Arrows indicate information flowLabels describe kind of informationIn some cases two-directional connectors
I Labels should be put near arrows
Conceptual components o�en have no direct counterpart in the final so�wareI … no need to care about physical location
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 6 / 53
Simple example
Figure: Model-car control system from So�ware Architecture PrimerRoman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 7 / 53
Simple example
SupervisoryI Receive commands and decode themI Send command data to real-time componentsI Send selected data to remote interface
BrakingI Apply braking force in percentage amountI Generate thro�le inhibit signal
SteeringI Set steering gear to selected angle
EFII Control spark and injection timingI Control amount of fuel injected
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 8 / 53
Designing Conceptual ArchitectureHow to approach conceptual architecture design?
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 9 / 53
Design process
1 Create the initial conceptual architecture from requirements2 Elaborate focusing on functionality3 Elaborate focusing on quality a�ributes (non-functional requirements, contextual
requirements)4 Iterate over 2 and 3
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 10 / 53
Design process
Initial steps1 Identify key concepts
I Within requirementsI Within narratives, …
2 Assign key concepts to categories:I Data, Function, Stakeholder, System, Abstract Concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 11 / 53
The first step
Practical exercise1 Underline the key concepts in the requirements
I Does this concept relates to the functionality?2 Copy key concepts onto a sheet
I Consider each one to see if it is a viable component3 Draw the components and add connectors
I Add arrows and labels
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 12 / 53
Example Application - Functional requirements
UR1: The system is a navigation tool. The system can calculate the following optimalroutes.
I UR1.1: Shortest pathI UR1.2: Fastest routeI UR1.3: Most economical (lowest CO2 emissions)I UR1.4: CheapestI UR1.5: Pleasant
F UR1.5.1: �ietestF UR1.5.2: Most sightseeing spotsF UR1.5.3: Along rivers and through parks
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 13 / 53
Example Application - Functional requirements
UR2: The places are stored in a database
UR3: The connections between the places are stored in the database
UR4: The connections need to contain the transportation mode and provider
UR5: The administrator can add/remove new places and connections
UR6: The user can search for places
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 14 / 53
Example Application - Functional requirements
UR7: The system needs to interact with external servicesI UR7.1: The system needs to buy tickets for the tramway
UR8: The system needs to draw the route on a interactive mapUR9: The system needs to provide user management
I UR9.1: Register new usersI UR9.2: Log-in / Log-outI UR9.3: Store user preferencesI UR9.4: Store credentials for purchase
…
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 15 / 53
The second step
Assign every possible concept from the requirements to a category:
Data: information that is stored, processed, etc. → Not directly a component but youmight need components for data management
Function: Something done by something→ typically components
Stakeholder: users, organizations→ never components
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 16 / 53
The second step
Assign every possible concept in a system narrative to a category:
System: external systems→ sometimes you need an interface component
Hardware→ physical components
Abstract concept: explanation of something→ rarely components
With the goal to identify all components…
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 17 / 53
Key Concepts
navigation tool
Abstract conceptcalculate Functionoptimal route Abstract conceptshortest path Abstract conceptfastest route Abstract conceptmost economical Abstract conceptcheapest Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate
Functionoptimal route Abstract conceptshortest path Abstract conceptfastest route Abstract conceptmost economical Abstract conceptcheapest Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate Functionoptimal route
Abstract conceptshortest path Abstract conceptfastest route Abstract conceptmost economical Abstract conceptcheapest Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate Functionoptimal route Abstract conceptshortest path
Abstract conceptfastest route Abstract conceptmost economical Abstract conceptcheapest Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate Functionoptimal route Abstract conceptshortest path Abstract conceptfastest route
Abstract conceptmost economical Abstract conceptcheapest Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate Functionoptimal route Abstract conceptshortest path Abstract conceptfastest route Abstract conceptmost economical
Abstract conceptcheapest Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate Functionoptimal route Abstract conceptshortest path Abstract conceptfastest route Abstract conceptmost economical Abstract conceptcheapest
Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate Functionoptimal route Abstract conceptshortest path Abstract conceptfastest route Abstract conceptmost economical Abstract conceptcheapest Abstract conceptpleasant
Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
navigation tool Abstract conceptcalculate Functionoptimal route Abstract conceptshortest path Abstract conceptfastest route Abstract conceptmost economical Abstract conceptcheapest Abstract conceptpleasant Abstract concept
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 18 / 53
Key Concepts
places Datadatabase Dataconnections Datatransportation mode Dataadministrator Stakeholderadd/remove (places) Functionuser Stakeholdersearch Function
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 19 / 53
Key Concepts
external services Systembuy (ticket) Functionticket Datatramway Datadraw Functionroute Datainteractive map Abstract conceptuser management Functionregister Functionusers Datalog-in / log-out Functionuser preference Datacredentials Datapurchase Function
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 20 / 53
Categorisation
Data Function Stakeholder System Abs.conceptplaces calculate administrator external services navigation tooldatabase add/remove (places) user optimal routeconnections search shortest pathtransp. mode buy (ticket) fastest routetramway draw most economicalroute user management cheapestusers register pleasantuser preference log-in / log-out interactive mapcredentials purchaseticket download
register
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 21 / 53
Conceptual Architecture: Best Practice
Start with stakeholders and external systems
Think about the data, data exchange and data storage
Think about active components, that trigger events
Combine the functions into groups of related functionality
Optionally, use narratives as guide how to group the components
→ draw a first iteration
Validate the first iteration
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 22 / 53
Conceptual Architecture: Iteration 1
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 23 / 53
Component responsibilities
AppUII ShowPlacesI DisplayMapI DrawRouteI DisplayTicket
AdminPanelI ListPlacesI ListConnections
NavigationServiceI StartCalculationI BuyTicketI RouteComputedI TicketPurchased
AdminServiceI AddPlaceI RemovePlace
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 24 / 53
Component responsibilities
RouteFinderI ComputeRoute
TicketsI ListPricesI StartPurchase
UserManagerI RegisterUserI LoginUserI GetSeasonalTickets
GeoinformationManagerI AddPlaceI RemovePlaceI SearchPlace
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 25 / 53
Iterations
Iterate over functional and non-functional requirements:
Functional seems to be OKNon-functional: performance as a quality a�ribute
I → Factor out the search functionality (e.g. search for places, …)
Also, design for changeI → Abstract external systems through interface (e.g. new public transportation system)
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 26 / 53
Conceptual Architecture: Iteration 2
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 27 / 53
Component responsibilities
SearchI SearchPlaces
PublicTransportAPII ListPricesI BuyTicket
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 28 / 53
Behaviour ModelThe dynamic aspect of conceptual architecture?
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 29 / 53
Behavioural exploration
Until now only structural architecture
We need to take into account behaviour of the systemTypically accomplished through usage narratives
We can take two/three usage scenarios and draw use-case maps
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 30 / 53
Component StereotypesTypes of components and connectors in conceptual architecture
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 33 / 53
Component stereotypes
Adding semantics to components through stereotypes
Tagging components to indicate certain properties
Presentation component: interactions with users
Persistent storage: persistent data or data from external systems
Real-time components: components that handle requests “quickly”
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 34 / 53
Component stereotypes
Figure: Source: So�ware Architecture Primer
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 35 / 53
Data Models
Data models capture the nature of information in the domain
If data exchanged between components is complex we might need to create data models
In our case: datasets and calculations
In both cases we need to define a format, e.g. UML
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 37 / 53
Script of Conceptual Architecture
Steps of developing the conceptual architecture1 Clarify components & responsibilities
I → e.g. by use of use-case maps2 Clarify connectors
I → e.g. by labelling information flow
3 Evaluate behaviour (against expected scenarios)4 Identify stereotypes & structures5 Define the data structure & models6 Simplify architecture
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 38 / 53
Design GuidelinesPractical aspects of conceptual architecture?
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 39 / 53
Conceptual arch. design rules
Guidelines for defining componentsGranularity
Cohesion
Coupling
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 40 / 53
Conceptual arch. design rules
Granularity of componentsAmount of functionality assigned to a single component
Depends on the context of the component
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 41 / 53
Conceptual arch. design rules
Avoid blobs: components that have too many responsibilities
Recognized by: one component has all the responsibility, others have single responsibilities
Reason 1: too much details in responsibilities
Reason 2: too lazy too divide responsibilities
Put more e�ort in dividing responsibilities
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 42 / 53
Conceptual arch. design rules
Avoid command clusters: a couple of components all with a single responsibility but allinterconnected
Recognized by: too many connectors between a set of components
Reason: responsibilities are in fact related
Combine components into a single component
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 43 / 53
Cohesion
Cohesion: how well are the responsibilities of a component related to each other
If the relationship is high, then the cohesion is high as well
High cohesion is considered to be good, as it makes the architecture easier to understand
Will help to maintain the system
Will help to design components that will be reused
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 44 / 53
Coupling
Coupling: degree to which so�ware components depend on each other
The degree is influenced on a couple of aspects (more than in OO languages)
E.g. how generic is the protocol?
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 45 / 53
Degree of Coupling
Loose coupling vs. tight couplingThese are the both extremes
In existing systems this is o�en a continuum
Components might be tightly in one aspect and loosely coupled in another
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 46 / 53
Aspects of Coupling
Level Loose Coupling Tight CouplingPhysical coupling Physic intermediary Direct physical link requiredCommunication style Asynchronous SynchronousType system Data-centric, self-contained
messagesOO-Style, complex object trees
Control of process logic Distributed logic components Central controlPlatform dependencies OS- and programming language
independentStrong OS and programminglanguage dependencies
Source: Enterprise SOA
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 47 / 53
Consequences of Tight Coupling
If one so�ware component changes, the other (dependant) components need to be changedas well
API/protocol specific to the needed requirements
O�en enforced by cross-cu�ing concerns
Typically it is easier (less e�ort) to create tightly coupled components
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 48 / 53
Consequences of Loose Coupling
Components can be easily exchanged
Components will be be�er suited to be reusedComponents are required to be more generic
I e.g., use standard protocols instead of custom ones
Will typically require more e�ort and be�er design/planning
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 49 / 53
Type of Coupling in Regard to�ality A�ributes
Coupling has an impact on quality a�ributesLoose coupling will typically improve maintainability, evolvability, reusability
Tight coupling will typically improve the achievable performance (and traceability)
For some a�ributes it is not clear, e.g. testability
⇒ Therefore slight preference to loose coupling
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 50 / 53
Examples of Coupling
Tight coupling between Service and the RouteFinderI Due to callback (both need to know each other, there might even be a temporal coupling here)
Loose coupling between Tickets and External System
The external system does not need to know the Ticket component
The external system might use a standard protocol
⇒ Easy to exchange the external system
Roman Kern (ISDS, TU Graz) Conceptual Architecture 2018-10-24 52 / 53