From Code To Architecture

Similar documents
Design Patterns. Gunnar Gotshalks A4-1

Software Development. Modular Design and Algorithm Analysis

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Object-Oriented Design

AR.04 Composite Application Guidance for WPF (aka Prism ) Brian Noyes IDesign Inc (

Composite Application Guidance for WPF and Silverlight (AKA Prism 2 )

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Topics in Object-Oriented Design Patterns

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

Practical Model-Driven Development with the IBM Software Development Platform

Implementing a Business Process

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Advanced Object Oriented PHP

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Object-Oriented Design

Rational Software White paper

Credit where Credit is Due. Goals for this Lecture. Introduction to Design

GOF Patterns Applied

The Release Reuse Equivalency Principle (REP) The Common Closure Principle (CCP) The Common Reuse Principle (CRP)

Information Systems Development Methodologies

Mapping UML Component Specifications to JEE Implementations

Architecture-Centric Evolution in Software Product Lines:

Enterprise Java Development using JPA, Hibernate and Spring. Srini Penchikala Detroit JUG Developer Day Conference November 14, 2009

Component based Development. Table of Contents. Notes. Notes. Notes. Web Application Development. Zsolt Tóth

This assignment requires that you complete the following tasks (in no particular order).

Software Architecture With ColdFusion: Design Patterns and Beyond Topics Outline Prepared by Simon Horwith for CFUnderground 6

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

XVIII. Software Architectures

Fast Track to EJB 3.0 and the JPA Using JBoss

Week 9 Implementation

Socket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.

APPLYING DESIGN PATTERNS TO SCA IMPLEMENTATIONS

Architecting ios Project. Massimo Oliviero

Setting the stage... Key Design Issues. Main purpose - Manage software system complexity by improving software quality factors

Lightweight J2EE Framework

Software Engineering

POJOs to the rescue. Easier and faster development with POJOs and lightweight frameworks

Software Service Engineering

Design Patterns V Structural Design Patterns, 2

Recalling the definition of design as set of models let's consider the modeling of some real software.

Living and Working with Aging Software. Ralph Johnson. University of Illinois at Urbana-Champaign

Idioms for Building Software Frameworks in AspectJ

Motivation. ! Stop reinventing the wheel, try to reuse code! ! How do you organize code reuse? History: " Copy & Paste. " Collect useful files

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns

An Introduction to Patterns

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Evaluation Guide for ASP.NET Web CMS and Experience Platforms

OO Frameworks. Introduction. Using Frameworks

J2EE Application Development : Conversion and Beyond Osmond Ng

Standards and the Portals Project

Requirements and Design Overview

Recitation 13. Software Engineering Practices and Introduction to Design Patterns

Build Testable Client and Service Applications

Coordination Patterns

Object Design II: Design Patterns

The Unified Modeling Language User Guide

CS 575: Software Design

THE ART OF SECURING 100 PRODUCTS. Nir

XIX. Software Architectures

Review Software Engineering October, 7, Adrian Iftene

Principles of Object-Oriented Design

Research Review on Basic Principles of Unified Modelling Language

Object-Oriented Software Development Goal and Scope

Appendix A - Glossary(of OO software term s)

SonarJ White Paper. Sonar stands for Software and Architecture. It is meant to support software developers and architects in their daily work.

SOFTWARE ENGINEERING SOFTWARE DESIGN. Saulius Ragaišis.

Modeling Enterprise Web Applications

Service-Oriented Architecture (SOA)

Lecture 2: Software Engineering (a review)

Web Application Development Using JEE, Enterprise JavaBeans and JPA

An introduction to the IBM Views and Viewpoints Framework for IT systems

Advanced Topics in WebSphere Portal Development Graham Harper Application Architect IBM Software Services for Collaboration

1. I NEED TO HAVE MULTIPLE VERSIONS OF VISUAL STUDIO INSTALLED IF I M MAINTAINING APPLICATIONS THAT RUN ON MORE THAN ONE VERSION OF THE.

CHAPTER 6: CREATIONAL DESIGN PATTERNS

1 OBJECT-ORIENTED ANALYSIS

Design Patterns Reid Holmes

Building Extensible XAML Client Apps

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Patterns and Testing

Spring Interview Questions

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET) NEED FOR DESIGN PATTERNS AND FRAMEWORKS FOR QUALITY SOFTWARE DEVELOPMENT

JOURNAL OF OBJECT TECHNOLOGY Online at Published by ETH Zurich, Chair of Software Engineering. JOT, 2002

Using JNDI from J2EE components

<Insert Picture Here> Oracle Policy Automation Connector For Siebel Features and Benefits

Java Language Modularity With Superpackages

Understading Refactorings

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)

Object-Oriented Design

Design Patterns. An introduction

INTERACTION ARCHITECTURAL MODELING. Lecture 9 Interaction Architectureal Modeling

Presenter: Dong hyun Park

Service-Oriented Architecture

HOW AND WHEN TO FLATTEN JAVA CLASSES?

Software Design And Modeling BE 2015 (w. e. f Academic Year )

Software Architecture and Design I

Information systems modelling UML and service description languages

Spring & Hibernate. Knowledge of database. And basic Knowledge of web application development. Module 1: Spring Basics

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

Chapter 10: Performance Patterns

Page 1

Transcription:

From Code To Architecture Kirk Knoernschild Chief Technology Strategist QWANtify, Inc. kirk@qwantify.com

Agenda Attempt the impossible Define Architecture Logical vs. Physical Design Component Heuristics

Software Architecture An architecture is the set of significant decisions about the organization of a software system, the selection of the structural elements and their interfaces by which the system is composed, together with their behavior as specified in the collaborations among those elements, the composition of these structural and behavioral elements into progressively larger subsystems, and the architectural style that guides this organization---these elements and their interfaces, their collaborations, and their composition (Kruchten: The Rational Unified Process. Also cited in Booch, Rumbaugh, and Jacobson: The Unified Modeling Language User Guide, Addison-Wesley, 1999).

Software Architecture In most successful software projects, the expert developers working on that project have a shared understanding of the system design. This shared understanding is called 'architecture.' This understanding includes how the system is divided into components and how the components interact through interfaces. These components are usually composed of smaller components, but the architecture only includes the components and interfaces that are understood by all the developers...architecture is about the important stuff. Whatever that is. (Fowler, Martin. IEEE Software, 2003. Who Needs and Architect. ) Quoting Ralph Johnson from the XP mailing list.

Software Architecture Structure Subsystems and components Interfaces Your code defines the structure, is pulled together to create subsystems and components, and is decoupled using interfaces. How is this so?

Heuristics General rules of thumb offering guidance in most usual situations. Not *always* appropriate. Is the usual case. Foundation of many common patterns. Techniques helping us tailor pattern to context.

Goals of Development Maximize reuse Faster development Ease maintenance Less error prone changes Faster changes Coupling and Cohesion must always be managed.

Logical Design Relationship between classes. Two types of relationships Dependency Inheritance Emphasis on maintenance and extensibility. Relevant on all size systems.

Physical Design Structure of files (.jar) and directories (packages). Dependencies exist between these structures. Emphasis on reuse, build, and deploy. Relevant mainly to large systems. Modularity to resolve complexity

POJO Components Binary unit of deployment.jar file Relationships build upon each other Class relationships enable Package relationships enforce Component relationships achieve Aren t coupled to a container

ComponentRelationships Design component relationships If changing the contents of a component, C2, may impact the contents of another component, C1, we can say that C1 has a Physical Dependency on C2. [JOUP02]

Direct Dependency The client component cannot be deployed without the service component.

Indirect Dependency The client component cannot be deployed without the service or subsystem component.

PhysicalLayers Component relationships should not violate the logical layers. Common logical layers Presentation Business Logic Data Access

Logical Layers For small systems, all may be in the same.jar file. For larger systems, breaking these apart can increase reusability. And if you do break them apart, the physical relationships *must* be enforced.

Layer Violation

Violation Corrected

BillPay System Design a system to handle payment and auditing of various types of bills. The system must integrate with 3 rd party auditing software, and a legacy financials system that must be fed payment information for reconciliation.

Version 1 Class Diagram Note the bi-directional associations.

Version 1 Component Diagram

Physical Separation

AbstractComponents Depend upon the abstract elements of a component. In other words, depend on abstract classes or interfaces.

Abstract Dependency client.jar Inject the implementation into Client. Lookup the implementation within Client. service.jar

Concrete Dependency What if Bill must be able to use different auditing systems?

Abstract Dependency AuditFacade1 is injected into Bill as an AuditFacade type.

Component Relationships

AcyclicRelationships Component relationships must be acyclic. A cyclic relationship exists when you can trace your dependencies, and end where you started. Cycles tend to creep into a system unknowingly.

Cyclic and Acyclic Dependencies

Leveling Relationships 0 are leaf component 3 rd party components such as struts, spring, hibernate, etc. 1 are lowest level components independent of anything else or only leaf components. n level components dependent on n-1 level components. Can only be done if relationships are acyclic

Notes Cycles can be broken Escalation, Demotion, Callback The lower the level, the less volatile it must be. Less volatile more abstract Levelized components can be effectively (and independently) tested. Levelized components can be built in order from 1 to n LevelizedBuild

Recall - Abstract Dependency

Recall - Component Relationships

Acyclic Relationships

Levelized BillPay

SeparateAbstractions Separate abstractions from the classes that realize them. Directed Dependency Collocate abstraction and implementation Inverted Dependency Collocate abstraction and referencing class Eliminated Dependency Move abstraction to separate component

Direct Dependency

Inverted Dependency

Eliminated Dependency

Acyclic Relationships How do I integrate with another auditing system? Where does AuditFacade2 live?

Recall - Levelized BillPay Should I put AuditFacade2 in audit.jar?

Abstract Components

CollocateExceptions Exceptions should be close to the classes that throw them. Exceptions are often an afterthought. Consider using only unchecked exeptions. If you decide to change, you won t break everything.

Exception Placement AuditFacade throws the AuditException.

IndependentDeployment Components should be as independently deployable as possible. Minimize a component s outgoing dependencies. Wire components together Don t depend on the container Reduces reuse J2EE dependencies

Recall - Abstract Components How do I reuse bill.jar without financial.jar? Like in a batch application?

Recall Class Structure

Class Structure 1.) PayAction invokes Bill.pay() and passes BillPayAdapter as a BillPayer. 2.) Bill.pay() invokes BillPayer.generateDraft() 3.)BillPayAdapeter.generateDraft() invokes Payment.generateDraft() passing itself as a Payable. 4.) Payment.generateDraft() invokes Payable.getAmount()

Reusing bill.jar

ImplementationFactory Use factories to create a component s implementation. new violates AbstractDependency Manage carefully

Factory Class

Final Structure

Extension

Analyzing Jar Files Run Jar Analyzer Generates xml showing dependencies between.jar files. Ant task available to run as part of build process. Feedback? Contributions? Available at www.kirkk.com

Additional Resources www.kirkk.com JarAnalyzer download and general information on software development. Whitepapers, articles, and blogs on a variety of technical topics. www.extensiblejava.com Resource devoted exclusively to dependency management. Please complete your session evaluation forms