Kirk Knoernschild OSGi in the Enterprise Analyst, SDLC and Agility, Modularity, and Architecture’s Paradox Containers, Languages, & Frameworks JAX London & OSGi DevCon Burton Group February 23rd, 2010 www.burtongroup.com kknoernschild@burtongr oup.com Blog: http://apsblog.burtongrou p.com Blog: http://techdistrict.kirkk.co m Twitter: pragkirk
OSGi in the Enterprise “First they ignore you, then they ridicule you, then they fight you, then you win.” -- Mahatma Gandhi OSGi is a disruptive technology that will transform how enterprise Java applications are designed, developed, and managed!
OSGi in the Enterprise 197 2
OSGi in the Enterprise Complexity Architectural Agility Paradox Modularity
OSGi in the Enterprise Complexity Why is software so What’s the role of complex? How do we tame modularity? complexity?
Complexity Rising Cost of Software Complexity - 120 billion loc in 1990 Source: - 250 billion loc in 2000 http://users.jyu.fi/~koskinen/smcosts.htm - loc doubles every 7 years - 50% of development time spent understanding code - 90% of software cost is maintenance & evolution Perspective: Not only double the past 7 years, but more than total amount ever written combined!
Complexity Case in Point 500 % 2002 2008
Complexity Reason to Celebrate Lehman’s Law: As a system evolves, its complexity increases unless work is done to maintain or reduce it. www.luma xart.com/
Complexity BAUF Doesn’t Cut It We are often asked to design solutions to problems that require knowledge we currently do not possess.
Complexity Gall’s Law A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over, beginning with a working simple system.
Complexity Question -------------------------------------------------------------- - How do we manage software complexity? Answer -------------------------------------------------------------- - Modularity
Complexity Defining Module Hey, it’s a JAR file! - unit of reuse - unit of composition - unit of deployment - unit of management A module system provides a runtime environment for modules
Complexity Advantages of Modularity Increases architectural agility! - reuse - reduce complexity - ease maintenance - increase extensibility Umm...we can already do this with objects and services!
Complexity Module Design Few teams are designing modular software systems today! POLL: Question: Response: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - How many design class relationships? _____ - How many design package relationships? _____ - How many design service relationships? _____ - How many design module (JAR, Assembly) relationships? _____
Complexity Platform Modularity Why aren’t we Platforms discourage modularity! designing more modular software?
Complexity Platform Modularity This is the next generation application platform! - Dynamic deployment - Multiple versions - Enforce dependencies
OSGi in the Enterprise Architectural Agility What is architecture? What is the goal of What is architectural architecture? agility?
Architectural Agility What is 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 elements and behavioral elements into progressively larger subsystems, and the architecture style that guides this organization -- these elements and their interfaces, their collaborations, and their composition. Source: Kruchten: The Rational Unified Process. Also cited in Booch, Rumbaugh, and Jacobson: The Unified Modeling Language User Guide, Addison-Wesley, 1999
Architectural Agility What is 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. Source: Fowler, Martin. IEEE Software, 2003. “Who Needs an Architect?” A quote from Ralph Johnson on the XP mailing list.
Architectural Agility What is Architecture? The fundamental organization of a system, embodied in its components, their relationships to each other and the environment, and the principles governing its design and evolution. Source: ANSI/IEEE Std 1471-2000
Architectural Agility What is Architecture? A formal description of a system, or a detailed plan of the system at component level to guide its implementation The structure of components, their inter-relationships, and the principles and guidelines governing their design and evolution over time. Source: TOGAF - http://www.opengroup.org/architecture/togaf8- doc/arch/chap01.html
Architectural Agility What is Architecture? Architecture embodies the critical design decisions that typify a system. Relates to cost of change, organizational structure, structure of code, capabilities of a system, etc. The significance of decisions needs to be understood and assessed A heavy-weight approach is likely to reduce understanding and our ability to assess Source: QCON London Presentation by James Coplien & Kevlin Henney title Agile Architecture Is not Fragile Architecture - http://www.infoq.com/presentations/Agile-Architecture-Is-Not-Fragile- Architecture-James-Coplien-Kevlin-Henney
Architectural Agility We need to The Goal of Architecture eliminate What if we were architecture! able to reduce the impact and cost of change?
Architectural Agility Re Irr v ee v rsi er b si le bl D e e D c e isi ci o si n o s ns ca ar n e b n e o t R e eve asi as liy l rs c ibi halitnyge chan d ge d bec e au a se se the hey are too ar e chi xpete n ct sivu e r e o ri s r a e bl so e u rto ce acco inte mmo nsive. date change. First and foremost, we should try to make most decisions reversible, so they can be made and then easily changed. -- “Implementing Lean Software Development: From Concept to Cash” Irreversible Decisions should be made as late as possible!
Architectural Agility Defeating Complexity
OSGi in the Enterprise Paradox How do we design How do we realize the Are we doomed to more flexible software dream of reuse? failure? systems?
Paradox Architecture Paradox Increasing evolvability decreases survivability ... making everything easy to change makes the entire system very complex... - Ralph Johnson in “Who Needs an Architect”
Paradox Tension Maximizing reuse complicates use - SOLID - Design Patterns - Modularity Patterns - SOA Principles
Paradox We must recognize which Arch area itecture s of the Paradox system demand the increased complexity that will bring greater flexibility! Increasing evolvability decreases survivability ... making everything easy to change makes the entire system very complex... - Ralph Johnson in “Who Needs an Architect”
OSGi in the Enterprise Modularity How does modularity How does modularity How does modularity help increase help us realize reuse? help us overcome the architectural agility? paradox?
Modularity Flexibility Where? Here? Which area of the Here? system demands more flexibility? Here? Here? Here? Here? Here?
Modularity Something is Missing ?
Modularity Turtles & Architecture What does architecture have to do with turtles? “You’re very clever, young man, very clever”, said the old lady. “But it’s turtles all the way down!” -- A Brief History of Time Photo courtesy of: http://www.flickr.com/photos/mybloodyself/1108834349/
Modularity Architecture “all the way down” ? Reuse Release Equivalence: Unit of reuse is the unit of release!
Modularity Shared Understanding
Modularity Architectural Joints Here? Which area of the Here? system demands more flexibility? Here? Here? Here? Here? Here?
Modularity as change occurs modules and their dependencies isolate change
Modularity Before and After
Modularity It’s All Good!
Modularity Modular Architecture - Where to Now? Infrastructure Programming Model - Design Paradigm - Runtime platform The frameworks and - The techniques used support helps technologies that to identify and create enforce modular allow us to create the right set of architecture. modular software modules The Design Paradigm - What’s the right granularity for a module? - What the right weight for a module?