09:18© 2005-2008, hello2morrow1 Golden Rules to Improve Your Architecture Alexander v. Zitzewitz hello2morrow Inc.

Slides:



Advertisements
Similar presentations
Bartłomiej Bodziechowski 1, Eryk Ciepiela 2, Marian Bubak 1,2 1 AGH University of Science and Technology, Department of Computer Science AGH, 2 AGH University.
Advertisements

•7/12 /07 F-1 © 2010 T. Horton CS 4240 Principles of SW Design Packages in Java and UML.
Design Concepts and Principles
e-Framework Components and Responsibilities.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
1 © Wolfgang Pelz UML3 UML 3 Notations describe how to use reusable software. Package Component Deployment Node.
Thee-Framework for Education & Research The e-Framework for Education & Research an Overview TEN Competence, Jan 2007 Bill Olivier,
THE OBJECT-ORIENTED DESIGN WORKFLOW Interfaces & Subsystems.
R R R CSE870: Advanced Software Engineering: Frameworks (Cheng, Sp2003)1 Frameworks A Brief Introduction.
Software Factory Assembling Applications with Models, Patterns, Frameworks and Tools Anna Liu Senior Architect Advisor Microsoft Australia.
1 Building with Assurance CSSE 490 Computer Security Mark Ardis, Rose-Hulman Institute May 10, 2004.
1 CS115 Class 7: Architecture Due today –Requirements –Read Architecture paper pages 1-15 Next Tuesday –Read Practical UML.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
1 A Student Guide to Object- Orientated Development Chapter 9 Design.
Logical Architecture and UML Package Diagrams
Approaches to ---Testing Software Some of us “hope” that our software works as opposed to “ensuring” that our software works? Why? Just foolish Lazy Believe.
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
Design Dan Fleck CS 421 George Mason University. What is the design phase? Analysis phase describes what the system should do Analysis has provided a.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Alexander Serebrenik, Serguei Roubtsov, and Mark van den Brand D n -based Design Quality Comparison of Industrial Java Applications.
1 A pattern language for security models Eduardo B. Fernandez and Rouyi Pan Presented by Liping Cai 03/15/2006.
©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Component-based development l Building software from reusable components l Objectives.
11:57© , hello2morrow1 Software Sustainability Alexander v. Zitzewitz hello2morrow, Inc.
Architecting Web Services Unit – II – PART - III.
Architecture GRASP Realization of use cases in interaction diagrams Design class diagram Design ( how )
Design Design and Software Architecture. The design phase The analysis phase describes what the system should be doing The design phase describes how.
Odyssey A Reuse Environment based on Domain Models Prepared By: Mahmud Gabareen Eliad Cohen.
Method-Oriented B2B Application Integration Chapter 4 Sungchul Hong.
Basic Concepts Software Architecture. What is Software Architecture? Definition: – A software architecture is the set of principal design decisions about.
CPT Week, Apr Lassi A. Tuura, Northeastern University Software Quality with Ignominy Lassi A. Tuura Northeastern.
L8 - March 28, 2006copyright Thomas Pole , all rights reserved 1 Lecture 8: Software Asset Management and Text Ch. 5: Software Factories, (Review)
SWE © Solomon Seifu ELABORATION. SWE © Solomon Seifu Lesson 12-5 Software Engineering Design Goals.
4/1/05F-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Packages and Components in Java and UML.
GRASP: Designing Objects with Responsibilities
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Introduction to Design Patterns Part 1. © Lethbridge/Laganière 2001 Chapter 6: Using design patterns2 Patterns - Architectural Architectural Patterns:
Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns.
Elements of OO Abstraction Encapsulation Modularity Hierarchy: Inheritance & Aggregation 4 major/essential elements3 minor/helpful elements Typing Concurrency.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Introduction to Software Architecture.
02:01© hello2morrow1 Love your Architecture Alexander v. Zitzewitz blog.hello2morrow.com.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
UML Package Diagrams. Package Diagrams UML Package Diagrams are often used to show the contents of components, which are often packages in the Java sense.
CSE 303 – Software Design and Architecture
Design Patterns in Context ©SoftMoore ConsultingSlide 1.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.
Subtopics: 1. Frameworks :Reusable systems 2. Design Patterns 1.
Principles of Package Design COMPOSE AT A HIGHER LEVEL OF ABSTRACTION.
Elaboration: Iteration 2. Elaboration: Iteration 2 Basics Iteration 1 ends with : All the software has been tested: The idea in the UP is to do early,
by C.A. Conley and L. Sproull
Metrics of Software Quality
Software Architecture & Difference from Design
Architecting Web Services
Architecting Web Services
Lecture 9- Design Concepts and Principles
Copyright © by Curt Hill
Software Quality Engineering
Principles of Package Architecture
Introduction to Design Patterns Part 1
Lecture 9- Design Concepts and Principles
Design Tips.
Software Design Lecture : 8
Software Testing “If you can’t test it, you can’t design it”
Better Architecture Management Made Easy
Dependency Inversion principle
Chapter 8 - Design Strategies
Jim Fawcett CSE687 – Object Oriented Design Spring 2015
Logical Architecture & UML Package Diagrams
Presentation transcript:

09:18© , hello2morrow1 Golden Rules to Improve Your Architecture Alexander v. Zitzewitz hello2morrow Inc.

09:18© , hello2morrow2 Your most frightening enemy: the dragon of complexity You Your enemy By the way, this is not a Chinese, but a European dragon. (They usually kidnap princesses)

09:18© , hello2morrow3 Erosion of Architecture – Symptoms (Robert C. Martin) Rigidity – The system is hard to change because every change forces many other changes. Fragility – Changes cause the system to break in conceptually unrelated places. Immobility – It's hard to disentangle the system into reusable components. Viscosity – Doing things right is harder than doing things wrong. Opacity – It is hard to read and understand. It does not express its intent well.

09:18© , hello2morrow4 Erosion of Architecture – Reasons System knowledge and skills are not evenly distributed Complexity grows faster than system size Unwanted dependencies are created without being noticed Coupling and complexity are growing quickly. When you realize it, it is often too late Management considers software as a black box Time pressure is always a good excuse to sacrifice structure The Law of Entropy?

Cost of Structural Erosion 09:18© , hello2morrow5

09:18© , hello2morrow6 Your System User Interface Business Logic Data Access Definition of a Logical Architecture Step 1: Cut horizontally into Layers Step 2: Cut vertically into vertical slices by functional aspects ContractsCustomerUserCommon Step 3: Defines the rules of engagement Natural subsystems

09:18© , hello2morrow7 Mapping of physical elements to logical elements Types and packages must be mapped to architectural artifacts A good naming convention for package‘s can make your life very simple E.g.: com.hello2morrow.project.verticalslice.layer… Think about the interfaces of architectural artifacts Work incrementally and iterative Start with your layering Then add the vertical slices (if applicable) Define subsystem interfaces Fine tune dependency rules

09:18© , hello2morrow8 Only Flexible Architectures are Good Architectures You are always shooting on moving targets To gain flexibility and potential re-usability you have to minimize coupling Always avoid cyclic dependencies Your systems flexibility is inverse proportional to its coupling

09:18© , hello2morrow9 How to keep the coupling low? Dependency Inversion Principle (Robert C. Martin) Build on abstractions, not on implementations Best pattern for a flexible architecture with low coupling Have a look at dependency injection frameworks (e.g. Spring)

09:18© , hello2morrow10 How to measure coupling ACD = Average Component Dependency Average number of direct and indirect dependencies rACD = ACD / number of elements NCCD: normalized cumulated component dependency CCD = 15 ACD = 15/6 = 2, Dependency Inversion ACD = 12/6 = Cycles ACD = 26/6 = 4,33

09:18© , hello2morrow11 Architecture metrics of Robert C. Martin D i = Number of incoming dependencies D o = Number of outgoing dependencies Instability I = D o / (D i +D o ) Build on abstractions, not on implementations X is „stable“ Y is „instable“

09:18© , hello2morrow12 Abstractness (Robert C. Martin) N c = Total number of types in a type container N a = Number of abstract classes and interfaces in a type container Abstractness A = N a /N c

09:18© , hello2morrow13 D = A + I – 1 Value range [ ] Negative values are in the „Zone of pain“ Positive values belong to the „Zone of uselessness“ Good values are close to zero (e.g. -0,25 to +0,25) „Distance“ is quite context sensitive Metric „distance“ (Robert C. Martin)

Cyclic dependencies are evil "Guideline: No Cycles between Packages. If a group of packages have cyclic dependency then they may need to be treated as one larger package in terms of a release unit. This is undesirable because releasing larger packages (or package aggregates) increases the likelihood of affecting something." [AUP] "The dependencies between packages must not form cycles." [ASD] "Cyclic physical dependencies among components inhibit understanding, testing and reuse. Every directed a-cyclic graph can be assigned unique level numbers; a graph with cycles cannot. A physical dependency graph that can be assigned unique level numbers is said to be levelizable. In most real-world situations, large designs must be levelizable if they are to be tested effectively. Independent testing reduces part of the risk associated with software integration " [LSD]

Example : Cyclic Dependency AlarmClock AlarmHandler PresentationModel Main AlarmToConsole AlarmToFile

Breaking the Cycle AlarmClock > AlarmHandler Main > IAlarmHandler AlarmToConsole AlarmToFile Presentation > Model

09:18© , hello2morrow17 Six Golden Rules for a Successful Project Rule 1: Define a cycle free logical architecture down to the level of subsystems and a strict and consistent package naming convention Rule 2: Do not allow cyclic dependencies between different packages Rule 3: Keep the relative ACD low (< 7% for 500 compilation units, NCCD < 6) Rule 4: Limit the size of Java files (700 LOC is a reasonable value) Rule 5: Limit the cyclomatic complexity of methods (e.g. 15) Rule 6: Limit the size of a Java package (e.g. less than 50 types)

Tools to Enforce the Golden Rules Commercial Tools Lattix Structure101 SonarJ (free up to 500 classes) Open Source PMD (metrics only) jDepend (dependencies) Architecture Rules (on top of jDepend) 09:18© , hello2morrow18

09:18© , hello2morrow19 You have won the heart of the princess after your were able to calm the dragon of complexity by following the five golden rules

09:18© , hello2morrow20 Awards and nominations Second prize of Jax innovation award in April 2007 Nomination for European ICT prize 2007 Awarded as most exciting innovation on Systems 2005

09:18© , hello2morrow21 Some of our Customers and Partners Accenture BearingPoint Electronic Arts Commerzbank PlanetHome Teambank T-Systems IBM Global Services eBay Motors Société Générale AM Gemalto Farm Credit Canada University of Michigan Sanofi-Aventis Austrian National Bank French Army Credit Suisse Daimler Austrian Environment Agency Unilog Géndarmerie Nationale (France) Volkswagen Austrian Government Siemens Business Objects ImmobilienScout 24

09:18© , hello2morrow22 Your questions… Download free architecture rules white paper from: My address: