8. Framework architectures

Samankaltaiset tiedostot
Kehyspohjainen ohjelmistokehitys

8. Kehysarkkitehtuurit

11. Kehysarkkitehtuurit

7.4 Variability management

7. Product-line architectures

11. Kehysarkkitehtuurit

Johdanto Kehystyypit Kehysten arkkitehtuurilähestymistavat Kehykset ja suunnittelumallit Kehysten etuja ja ongelmia Yhteenvetoa

Ohjelmistoarkkitehtuurit

Ohjelmistoarkkitehtuurit. Kevät

Encapsulation. Imperative programming abstraction via subprograms Modular programming data abstraction. TTY Ohjelmistotekniikka

Ohjelmistoarkkitehtuurit kehysarkkitehtuurit. Kevät 2014

Capacity Utilization

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

Ohjelmistoarkkitehtuurit kevät Muunneltavuuden hallinta: variaatiopisteet. Ohjelmistot muuntuvat kahdessa dimensiossa

Other approaches to restrict multipliers

Enterprise Architecture TJTSE Yrityksen kokonaisarkkitehtuuri

12. Kehysarkkitehtuurit

Efficiency change over time

T Software Architecture

C++11 seminaari, kevät Johannes Koskinen

Data Quality Master Data Management

1. SIT. The handler and dog stop with the dog sitting at heel. When the dog is sitting, the handler cues the dog to heel forward.

Windows Phone. Module Descriptions. Opiframe Oy puh Espoo

National Building Code of Finland, Part D1, Building Water Supply and Sewerage Systems, Regulations and guidelines 2007

Innovative and responsible public procurement Urban Agenda kumppanuusryhmä. public-procurement

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

1 Introduction. TTY Ohjelmistotekniikka. Ohjelmistoarkkitehtuurit Syksy 2006

On instrument costs in decentralized macroeconomic decision making (Helsingin Kauppakorkeakoulun julkaisuja ; D-31)

Gap-filling methods for CH 4 data

2 Description of Software Architectures

Information on preparing Presentation

Moniulotteisten ohjelmistojen hallinta

Network to Get Work. Tehtäviä opiskelijoille Assignments for students.

Ohjelmistoarkkitehtuurit kehysarkkitehtuurit. Kevät 2016

Uusi Ajatus Löytyy Luonnosta 4 (käsikirja) (Finnish Edition)

HITSAUKSEN TUOTTAVUUSRATKAISUT

Collaborative & Co-Creative Design in the Semogen -projects

Jussi Klemola 3D- KEITTIÖSUUNNITTELUOHJELMAN KÄYTTÖÖNOTTO

Hankkeen toiminnot työsuunnitelman laatiminen

DIGITAL MARKETING LANDSCAPE. Maatalous-metsätieteellinen tiedekunta

FinFamily Installation and importing data ( ) FinFamily Asennus / Installation

Arkkitehtuuritietoisku. eli mitä aina olet halunnut tietää arkkitehtuureista, muttet ole uskaltanut kysyä

Security server v6 installation requirements

Tietorakenteet ja algoritmit

FinFamily PostgreSQL installation ( ) FinFamily PostgreSQL

Tilausvahvistus. Anttolan Urheilijat HENNA-RIIKKA HAIKONEN KUMMANNIEMENTIE 5 B RAHULA. Anttolan Urheilijat

Microsoft Lync 2010 Attendee

Results on the new polydrug use questions in the Finnish TDI data

Smart specialisation for regions and international collaboration Smart Pilots Seminar

Security server v6 installation requirements

Skene. Games Refueled. Muokkaa perustyyl. for Health, Kuopio

RINNAKKAINEN OHJELMOINTI A,

anna minun kertoa let me tell you

LYTH-CONS CONSISTENCY TRANSMITTER

KONEISTUSKOKOONPANON TEKEMINEN NX10-YMPÄRISTÖSSÄ

CASE POSTI: KEHITYKSEN KÄRJESSÄ TALOUDEN SUUNNITTELUSSA KETTERÄSTI PALA KERRALLAAN

The CCR Model and Production Correspondence

Suomalainen koulutusosaaminen vientituotteena

Data protection template

WAMS 2010,Ylivieska Monitoring service of energy efficiency in housing Jan Nyman,

Returns to Scale II. S ysteemianalyysin. Laboratorio. Esitelmä 8 Timo Salminen. Teknillinen korkeakoulu

Tarua vai totta: sähkön vähittäismarkkina ei toimi? Satu Viljainen Professori, sähkömarkkinat

TIEKE Verkottaja Service Tools for electronic data interchange utilizers. Heikki Laaksamo

1.3Lohkorakenne muodostetaan käyttämällä a) puolipistettä b) aaltosulkeita c) BEGIN ja END lausekkeita d) sisennystä

ECVETin soveltuvuus suomalaisiin tutkinnon perusteisiin. Case:Yrittäjyyskurssi matkailualan opiskelijoille englantilaisen opettajan toteuttamana

Rakentamisen 3D-mallit hyötykäyttöön

Ohjelmointikielet ja -paradigmat 5op. Markus Norrena

Rekisteröiminen - FAQ

LANSEERAUS LÄHESTYY AIKATAULU OMINAISUUDET. Sähköinen jäsenkortti. Yksinkertainen tapa lähettää viestejä jäsenille

Mat Seminar on Optimization. Data Envelopment Analysis. Economies of Scope S ysteemianalyysin. Laboratorio. Teknillinen korkeakoulu

EVALUATION FOR THE ERASMUS+-PROJECT, STUDENTSE

A Plan vs a Roadmap. This is a PLAN. This is a ROADMAP. PRODUCT A Version 1 PRODUCT A Version 2. PRODUCT B Version 1.1. Product concept I.

BLOCKCHAINS AND ODR: SMART CONTRACTS AS AN ALTERNATIVE TO ENFORCEMENT

Salasanan vaihto uuteen / How to change password

BDD (behavior-driven development) suunnittelumenetelmän käyttö open source projektissa, case: SpecFlow/.NET.

Asiantuntijoiden osaamisen kehittäminen ja sen arviointi. Anne Sundelin Capgemini Finland Oy

Miehittämätön meriliikenne

3. Software components and interfaces

Object Framework - One. OF-1 is a high-productive Multi-UI OpenEdge data driven development framework. Veli-Matti Korhonen

WP3 Decision Support Technologies

Constructive Alignment in Specialisation Studies in Industrial Pharmacy in Finland

Choose Finland-Helsinki Valitse Finland-Helsinki

1.3 Lohkorakenne muodostetaan käyttämällä a) puolipistettä b) aaltosulkeita c) BEGIN ja END lausekkeita d) sisennystä

812336A C++ -kielen perusteet,

Paikkatiedon semanttinen mallinnus, integrointi ja julkaiseminen Case Suomalainen ajallinen paikkaontologia SAPO

SOA SIG SOA Tuotetoimittajan näkökulma

TietoEnator Pilot. Ari Hirvonen. TietoEnator Oyj. Senior Consultant, Ph. D. (Economics) presentation TietoEnator 2003 Page 1

ProAgria. Opportunities For Success

A new model of regional development work in habilitation of children - Good habilitation in functional networks

TIE Ohjelmistojen suunnittelu

You can check above like this: Start->Control Panel->Programs->find if Microsoft Lync or Microsoft Lync Attendeed is listed

Green Growth Sessio - Millaisilla kansainvälistymismalleilla kasvumarkkinoille?

EUROOPAN PARLAMENTTI

AYYE 9/ HOUSING POLICY

TW-LTE 4G/3G. USB-modeemi (USB 2.0)

Fighting diffuse nutrient load: Multifunctional water management concept in natural reed beds

Hankkeiden vaikuttavuus: Työkaluja hankesuunnittelun tueksi

Operatioanalyysi 2011, Harjoitus 4, viikko 40

Teknologia-arkkitehtuurit. Valinta ja mallinnus

Alternative DEA Models

Transkriptio:

8. Framework architectures 8.1 Introduction 8.2 Framework types 8.3 Developing frameworks 8.4 Frameworks and design patterns 8.5 Example: A simulator framework 8.6 Benefits and potential problems 8.7 Discussion 1

8.1 Introduction Motivation Product-line architecture: architecture for a software system family (similar systems sharing structure and functionality) Central aim: software reuse Prerequisite: the system family has sufficiently common features Framework = OO implementation technology for product-line platforms (architecture and basic common functionality) 2

What is a framework? Framework A collection of classes implementing the basic architecture for a family of software systems, to be specialized into an application using interface implementation inheritance creation and composition of objects instantiation of generic structures reflection 3

Cost benefits of frameworks: example A real videogame framework Trad. 1. game 2. game 3. game personhours 0 100 200 300 400 500 600 700 800 900 Framework Developing framework + training 1. game 2. game 3. game Performance: time +70% space +200% 4

Framework is specialized into an application Framework Applicationspecific part control Specialization interface 5

Framework is specialized into an application Framework Applicationspecific part control Specialization interface 6

Application framework vs. library Subclasses, components, Application specific code Application Reusable code Application framework Classes, modules Hollywood principle: don t call us, we call you 7

8.2 Framework types Application framework: specialization = application Framelet: specialization = component White-box framework: specialization using inheritance Black-box framework: specialization using composition Component framework: specialization using interfaces & components Abstract framework: consists of interfaces Layered framework: consists of stepwise specialized layers 8

White-box frameworks A B 9

Black-box frameworks A B <<create>> 10

Component frameworks 11

Example framework: simulating creature populations 12

<<framework>> SimulationFW White-box framework <<interface>> Creature setmyworld(world) show() getx(): int gety(): int move() interact(creature) growold() die() * World getsize(): int add(creature) remove(creature) show() simulate(int, CreatureFactory) <<interface>> CreatureFactory 1 createcreature(): Creature DefaultCreature <<create>> DefaultCreatureFactory xcoord ycoord age setmyworld(world)... die() <<create>> createcreature(): Creature EatingCreature energy interact(creature) SimulationApp main() <<create>> <<create>> EatingCreatureFactory createcreature(): Creature 13

<<framework>> SimulationFW Black-box framework <<interface>> Creature setmyworld(world) show() getx(): int gety(): int move() interact(creature) growold() die() * World getsize(): int add(creature) remove(creature) show() simulate(int,creaturefactory) <<create>> <<interface>> CreatureFactory 1 createcreature(): Creature DefaultCreatureFactory DefaultCreature xcoord ycoord age setmyworld(world)... die() EatingCreature energy interact(creature) <<create>> <<create>> createcreature(): Creature EatingCreatureFactory createcreature(): Creature SimulationApp <<create>> main() 14

<<framework>> SimulationFW Abstract framework <<interface>> Creature setmyworld(world) show() getx(): int gety(): int move() interact(creature) growold() die() * <<interface>> World getsize(): int add(creature) remove(creature) show() simulate(int,creaturefactory) <<interface>> CreatureFactory 1 createcreature(): Creature MyCreature World MyCreatureFactory xcoord ycoord clock size createcreature(): Creature setmyworld(world)... die() getsize(): int simulate(int,creaturefactory) <<create>> SimulationApp <<create>> <<create>> main() 15

<<framework>> SimFrame Framelet Component framework <<framework>> FighterSimFrame <<interface>> Creature setmyworld(world) show() getx(): int gety(): int move() interact(creature) growold() die() * <<interface>> World getsize(): int add(creature) remove(creature) show() simulate(int) <<interface>> Fighter take(weapon) FighterCreature <<interface>> Weapon aim(creature) SpecFighterWorld getsize(): int add(creature) remove(creature) show() simulate(int) Sword <<create>> <<create>> <<create>> Manager main() 16

Monolithic frameworks vs. framelets Application Framework Specialization Component Component Monolithic framework Specialization Framelet Specialization Framelet 17

Layered and hierarchical frameworks 18

Layered and hierarchical frameworks 19

Layered framework Ant simulation product Ant simulation framework Insect simulation framework Default implementations Abstract simulation framework 20

Layered framework Network management applications Network management framework Swing AWT 21

Hierarchical framework Simulation products Ant simulation framework Spider simulation framework Insect simulation framework Rodent simulation framework Whale simulation framework Mammal simulation framework Default implementations Abstract simulation framework 22

8.3 Developing frameworks Variability requirements Specialization patterns Specialization guide Domain analysis Architecture design Detailed design Implementation Testing Design pattern catalogs 23

Flexibility requirement: Creature variation Structure DefaultCreature move show getx gety interact die growold Specialization pattern NewCreature move show getx gety interact die growold Explanations DefaultCreature: Default implementation for creatures NewCreature: Application dependent creature type move: Single movement behavior show: Displays creature on screen interact: Interaction between two creatures die: dying of a creature growold: aging of a creature Constraints move: must call "show" die: must remove the creature from the world growold: must increase age Example class NewCreature extends DefaultCreature { int energy; public NewCreature(int x, int y, int e) { super(x, y); energy = e; } public void move() { xcoord = (xcoord+1)%myworld.getsize(); show(); } public void show() {...} } public void interact(abstractcreature c) { if (c!= this && c instanceof NewCreature) { if (((NewCreature)c).energy < energy) { c.die(); } } } 24

Role-based specialization patterns Tool Application setup... instantiate RectangleTool... RectangleTool <<create>> Concept Client Instantiation Code ConcreteImpl instantiate 25

Role-based specialization patterns Tool Concept Client Instantiation Code ConcreteImpl instantiate 26

Tool support: JavaFrames Architecture-sensitive Java editor Current binding situation (containment tree) Adaptive tasks & instructions See http://practise.cs.tut.fi/ 27

8.4 Frameworks and design patterns AbsFactory createbutton(): Button createmenu(): Menu Framework (fixed part) GUI WinFactory Button Menu <<create>> WinButton WinMenu Application (variable part) 28

Typical design patterns supporting variation in a framework Template Method Strategy Chain of Responsibility Decorator Factories (e.g. Abstract Factory, Factory Method) Observer... 29

Template Method design pattern Problem: How to make static variations of a method? 30

Strategy design pattern Problem: How to change the implementation of a method at run-time during the lifetime of the host object? 31

Chain of Responsibility design pattern Problem: How to give more than one object (component) a chance to handle a service request, without making the sender of the request dependant of the receivers. 32

Decorator design pattern Problem: How to attach additional responsibilities to an object dynamically. 33

Observer Problem: How to let a set of objects respond to state changes of another object, without making the latter object dependent on the former ones. 34

Abstract Factory design pattern Problem: How to allow the creation of a members of a consistent family of entities, withouyt knowing the concrete entity classes? 35

8.5 Example: Simulation framework CoreRoot DefaultRoot EatingRoot dependency direction Logical dimension CoreGui DefaultGui EatingGui CoreManager DefaultManager EatingManager CoreFactories DefaultFactories EatingFactories CoreView DefaultView EatingView CoreModel DefaultModel EatingModel Specialization dimension 36

Layer analysis: logical dimension row depends on col Root Gui Manager Factories View Model Root X X X Gui X Manager X X X Factories X X View X Model 37

Layer analysis: specialization dimension row depends on column Eating Default Core Eating X X Default X Core 38

Class/interface categories Base Implementation which is assumed to be reused by all applications (final methods) Appears in the Core packages together with interfaces (no naming conventions for interfaces) Default Implementation which is assumed to be reused by many applications Appears in the Default packages Eating Implementation needed only for specialization X Appears in the Eating packages 39

Hints for Java framework development (1) General be careful about the law of gravity: is this functionality really something that all applications must have? default implementation should give a typical minimal application (never absolutely necessary implementation) make likely variations easy to implement, unlikely variations can be more difficult to implement threading is one way to combine frameworks divide long method bodies into calls of protected methods, to support fine-grained functional variability (defines order of actions, but not the contents) use final methods for non-variable behavior 40

Hints for Java framework development (2) Initializations only absolutely fixed things in straight constructor code, everything else in calls of separate protected methods default value settings into separate protected methods don't initialize in field declarations reusing objects is possible if public initialization is separated from constructor 41

8.6 BenefitsB and potential problems Benefits of frameworks as implementation technology for product-lines: lots of experience (e.g., GUI frameworks) straightforward OO technology allows both coarse and fine-grained specialization supports open-ended specialization process supports layered & hierarchical approaches 42

Potential problems of frameworks Designing a (good) framework is hard, often iterative Combining frameworks may be hard Frameworks may become monolithic and difficult to manage Non-functional variance difficult to implement Business-critical architects (reduces truck factor) Debugging of applications difficult without framework source 43

8.7 Discussion Application or application framework? Good OO application is often a specialization of an (implicit) framework 44

Do not apply the framework approach if you don't have thorough understanding of the domain for which you are going to build a framework; you have not built several applications already in the application domain; you don't have long experience in using OO methods, OO languages and design patterns; you cannot split the domain into manageable pieces, so that you would end up with a huge, monolithic framework instead of a number of small frameworks; the management is not committed to a long, possibly unpredictable framework development project. 45

Summary Framework technology is adopted by more and more enterprises, reported experiences mostly positive Product-line architecture can be implemented as a framework A framework may be a significant strategic advantage for an enterprise The development of a framework is much more difficult than that of a normal application To reduce the risk, do not make very large white-box frameworks 46