Architecture Rules Enforcement and Governance Using Aspects



Similar documents
MESSAGING SECURITY USING GLASSFISH AND OPEN MESSAGE QUEUE

Beginning POJOs. From Novice to Professional. Brian Sam-Bodden

Designing an Enterprise Application Framework for Service-Oriented Architecture 1

Aspect Weaving for OSGi. Martin Lippert (akquinet it-agile GmbH)

Spoilt for Choice Which Integration Framework to choose? Mule ESB. Integration. Kai Wähner

Glassbox: Open Source and Automated Application Troubleshooting. Ron Bodkin Glassbox Project Leader

How to Build an E-Commerce Application using J2EE. Carol McDonald Code Camp Engineer

OXAGILE RESUMES SUMMARY OF QUALIFICATIONS TECHNICAL SKILLS SENIOR JAVA SOFTWARE ENGINEER

Open Source egovernment Reference Architecture Osera.modeldriven.org. Copyright 2006 Data Access Technologies, Inc. Slide 1

Where Did My Architecture Go?

Developing modular Java applications

Oracle WebLogic Server 11g Administration

APAC WebLogic Suite Workshop Oracle Parcel Service Overview. Jeffrey West Application Grid Product Management

OpenShift is FanPaaStic For Java EE. By Shekhar Gulati Promo Code JUDCON.IN

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

SOA and BPO SOA orchestration with flow. Jason Huggins Subject Matter Expert - Uniface

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

ebay : How is it a hit

IBM Proof of Technology Discovering business application services, featuring IBM WebSphere Application Server Network Deployment V8

JBS-102: Jboss Application Server Administration. Course Length: 4 days

enterprise^ IBM WebSphere Application Server v7.0 Security "publishing Secure your WebSphere applications with Java EE and JAAS security standards

JAVA/J2EE DEVELOPER RESUME

Oracle Data Integrator 11g New Features & OBIEE Integration. Presented by: Arun K. Chaturvedi Business Intelligence Consultant/Architect

Customer Bank Account Management System Technical Specification Document

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

Deploying Rule Applications

Converting Java EE Applications into OSGi Applications

GlassFish Security. open source community experience distilled. security measures. Secure your GlassFish installation, Web applications,

Oracle WebLogic Server 11g: Administration Essentials

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

Coding in Industry. David Berry Director of Engineering Qualcomm Cambridge Ltd

White Paper: 1) Architecture Objectives: The primary objective of this architecture is to meet the. 2) Architecture Explanation

Oracle Application Development Framework Overview

Software Architecture Document

zen Platform technical white paper

Generating Aspect Code from UML Models

This presentation will provide a brief introduction to Rational Application Developer V7.5.

OptimalJ Foundation. PSM EJB Model. Roadmap. What is the EJB model? EJB model as a PSM model Mapping the EJB model Model elements and code generation

How to Build Successful DSL s. Jos Warmer Leendert Versluijs

What is Enterprise Architect? Enterprise Architect is a visual platform for designing and constructing software systems, for business process

Eclipse 4 RCP application Development COURSE OUTLINE

Software Construction

IBM InfoSphere MDM Server v9.0. Version: Demo. Page <<1/11>>

Ikasan ESB Reference Architecture Review

Visual Paradigm product adoption roadmap

Exam Name: IBM InfoSphere MDM Server v9.0

Continuous Integration For Fusion Middleware

Framework Adoption for Java Enterprise Application Development

Security in Domain-Driven Design. Author: Michiel Uithol

Core Java+ J2EE+Struts+Hibernate+Spring

Server-side OSGi with Apache Sling. Felix Meschberger Day Management AG 124

A COMPARISON OF AOP BASED MONITORING TOOLS

Operations and Monitoring with Spring

Chapter 1: Web Services Testing and soapui

SAP NetWeaver Opens SAP ERP world. Amedeo Prodi SAP Italia

Application Lifecycle Management Using Visual Studio 2013 (SCRUM)

Aspect-Oriented Programming

Enterprise Application Development In Java with AJAX and ORM

Rapid Application Development. and Application Generation Tools. Walter Knesel

Core J2EE Patterns, Frameworks and Micro Architectures

Oracle Data Integrator 11g: Integration and Administration

Oracle Data Integrator 12c: Integration and Administration

Improving Software Quality with the Continuous Integration Server Hudson. Dr. Ullrich Hafner Avaloq Evolution AG 8911

FUSE-ESB4 An open-source OSGi based platform for EAI and SOA

The leading platform for Model Driven Architecture (MDA) Content:

Web Development with the Eclipse Platform

JVA-122. Secure Java Web Development

Service Oriented Architectures

SOA, case Google. Faculty of technology management Information Technology Service Oriented Communications CT30A8901.

WebSphere ESB Best Practices

Jenkins User Conference Herzelia, July #jenkinsconf. Testing a Large Support Matrix Using Jenkins. Amir Kibbar HP

1 What Are Web Services?

Your Software Quality is Our Business. INDEPENDENT VERIFICATION AND VALIDATION (IV&V) WHITE PAPER Prepared by Adnet, Inc.

ALM2013VS_ACC: Application Lifecycle Management Using Visual Studio 2013

Service Oriented Architecture (SOA) Architecture, Governance, Standards and Technologies

Tomáš Müller IT Architekt 21/04/2010 ČVUT FEL: SOA & Enterprise Service Bus IBM Corporation

Build management & Continuous integration. with Maven & Hudson

A-Team Tech Talk Series. SOA Unit Testing. Olivier LeDiouris, Oracle A-Team

BUSINESS RULES CONCEPTS... 2 BUSINESS RULE ENGINE ARCHITECTURE By using the RETE Algorithm Benefits of RETE Algorithm...

Foundations of Model-Driven Software Engineering

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

Business Process Execution Language for Web Services

Software infrastructure for Java development projects

Choosing A Load Testing Strategy Why and How to Optimize Application Performance

SECURITY AND RISK MANAGEMENT

Jiří Šebek, Karel Richta. Department of Computer Science and Engineering Praha 2, Czech Republic

Oracle Identity Analytics Architecture. An Oracle White Paper July 2010

Application Testing Suite: A fully Java-based software testing platform for testing Oracle E-Business Suite and other web applications

Transcription:

Architecture Rules Enforcement and Governance Using Aspects Srini Penchikala SATURN 2009 About the Speaker Enterprise Architect Writer, Speaker, Editor (InfoQ) Detroit Java User Group Leader Working with Java since 1996, JEE (2000), SOA (2006), & PowerPoint since Sep 2008 Current: Agile Architectures, Domain-Driven Design, Architecture Enforcement, Model Driven Development Future: Role of DSL's in Architecture Enforcement 2 1

Goals for this Presentation Overview of Reference Architecture (RA) and its significance in EA How Aspects and AOP can help to enforce RA and manage Architecture Governance 3 Format Interactive Demos Duration: ~60 minutes Q & A Prerequisite: Familiarity with AOP and Aspects 4 2

Before we start How many currently have some kind of Reference Architecture in place? How many actually use RA to enforce architecture? 5 Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 6 3

Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 7 Reference Architecture A high-level system design which consists of: description of system components definitions of relationships between components definitions of relationships between system components & elements external to the system 8 4

Architecture Enforcement Architecture Rules: Rules (compile time as well as run time) used to assert architecture. Architecture Governance: Construct an Architecture Contract to govern overall implementation & deployment process. Perform appropriate governance functions while system is being implemented and deployed. Ensure conformance with defined architecture by implementation projects 9 Architecture Enforcement Maturity Model Level 0: No RA Level 1: RA is described in a Word/HTML/PDF document Level 2: Semi-automated checking mechanism for architecture enforcement Level 3: Fully automated checking mechanism 10 5

Why Architecture Enforcement? Checking mechanism to enforce Reference Architecture Match Requirements (Architecture) to Implementation (Code) Detect and prevent structural complexity Promotes consistency and modularity in the System Aids in Architecture, Design, and Code refactoring efforts 11 Architecture Rules Business v. Architecture Rules Architecture rules are as important as business rules Code Quality By Design Unit tests, TDD & BDD only help with code quality from functional requirements stand-point Need for a process to ensure code quality from design stand-point Technical Credit Good Design, Testable and Integrated Code Code that complies with Architecture/Design Policies 12 6

Types of Enforcement Layered architecture and application module dependencies API usage (internal and 3rd party) Coding Policies Code-Naming Conventions Design Patterns and Best Practices 13 Setup Types Static analysis Allows for easy visual representation Techniques AOP, AspectJ Tools Structure 101 SonarJ Lattix Dynamic analysis Based on the program flow Rule-set usable at runtime Techniques: AspectJ/Spring AOP 14 7

Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 15 Rule Categories Layered Architecture Separation Of Concerns Domain-Driven Design Infrastructure Miscellaneous 16 8

Rules - Layered Architecture Presentation layer should not use DAO classes directly Service layer never calls web layer DAO (Persistence) layer depends on no other layer except domain 17 Rules - Separation of Concerns No transaction management in DAO classes Only DAO's should reference javax.sql classes Only Controller classes are aware of Web/HTTP objects Service layer should be transactional External systems can not access internal implementation classes (*Impl classes) 18 9

Rules - Domain-Driven Design Service object creation via a Factory (i.e. no new Service() code) No direct access to DAO s except from Domain classes Business service that fails with a concurrency related failure can be retried 19 Rules - Infrastructure No direct use of API: Log4J or Commons Logging (use Framework Logger) JavaMail (use MailService component) FTP (use FileTransferService component) No System.out.println statement anywhere in the code 20 10

Rules - Miscellaneous All primary key classes (*PK.java) should implement Serializable interface All test classes should be named with the suffix Test 21 Persistence Hibernate session close only allowed in EJB's and Servlet Filters DAO's accessing DB Views use JDBC (no Hibernate) Use SpringJdbcTemplate for JDBC data access 22 11

Other Domain Concerns Auditing Domain state change tracking Monitoring Aspects to implement MonitorMBean interface Expose Results as an MBean Publish results using RSS feeds 23 Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 24 12

Approaches Code Inspections Architecture Reconstruction Model Driven Architecture (MDA) Code Generation Byte Code Instrumentation Enforcement Tools Aspect-oriented Programming (AOP) 25 Architecture Analysis Tools Macker ArchitectureRules Classycle PatternTesting Contract4J Structure 101, Lattix, SonarJ 26 13

Architecture Analysis Tools Structure 101 Slicing / Rules SonarJ Logical architecture definition & Physical mapping of architecture to Java code Lattix Dependency Structure Matrix showing the Desired vs. the Realized architecture implementation 27 Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 28 14

Aspect-oriented Programming Add behavior to objects in a non-obtrusive manner through static and dynamic crosscutting Code cross-cutting concerns in separate modules and apply them in a declarative way 29 AOP Use Cases Spring Framework Built-In Aspects: Transaction Management Security Custom Aspects: Profiling Caching Architecture Rules Contract Enforcement 30 15

AOP in Architecture Enforcement Provides the necessary abstraction to enforce rules Customized compile-time error or warning messages Less intrusive Target application code is not modified in any form Rules can be turned on or off any time 31 Enforcement: Aspects or Tools? Question: AOP or Tools? 32 16

Enforcement: Aspects or Tools? Tools: +Better enforcement options -Licensing costs Aspects +More flexibility for customization -Relatively intrusive -Not backed by an architecture meta model 33 Enforcement: Aspects or Tools? Question: AOP or Tools? Answer: It depends.. Choose the right tool to do the right job 34 17

Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 35 Architecture Rules Enforcement IDE (Eclipse, AJDT) Build Process Changes (Ant, CruiseControl) RSS Feeds (Rome) 36 18

Sample Application Tools: Eclipse AspectJ AJDT Spring AOP Ant 37 Sample Application - Eclipse 38 19

Layered Architecture Rules Service classes should not depend on Application layer classes 39 DEMO 40 20

Domain-Driven Design Rules No direct access to DAO's except from Domain classes (go through Domain or Repository objects) 41 Typical J2EE Architecture Model 42 21

Domain Driven Architecture 43 DEMO 44 22

DDD Rules Demo 2 Business service that fails with a concurrency related failure can be retried Caching example Spring AOP and EHCache Requirement: To cache specific data (objects) using a custom Annotation Annotation: @CacheEntity 45 DEMO 46 23

Infrastructure Rules No direct use of API: Log4J or Commons Logging (use Framework Logger) 47 DEMO 48 24

Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 49 CI Process Changes Build process changes to include Architecture rules task Part of build process (in Local and Integration environments) Deviations are published nightly as RSS feeds Identified deviations are used in conducting design and code reviews 50 25

Build Process Changes 51 Sample Application Ant Build 52 26

Agenda Reference Architecture & Enforcement Architecture Rules Categories Architecture Enforcement Approaches Aspect-oriented Programming Rules Demo(s) CI Process Changes Case Study Architecture Rules Aspects - Open Source Project 53 Case Study Implementation Plan: Phase 1 (Day 1): Enable rules but not enforce them (yet) Phase 2 (Day 16): Enable rules and enforce only critical Errors (No Warnings) Phase 3: Enable rules and enforce all deviations (Errors & Warnings) Phase 4: Enable rules and enforce all Errors and Warnings in all applications in the enterprise 54 27

Architecture Rules Aspects Open source Google project architecture-rules-aspects (http://code.google.com/p/ architecture-rules-aspects/) Future road-map: DSL to define architecture rules (e.g. Groovy) Define rules in a Rules Engine (JBossRules) 55 Implementation Road Map Publish rules along with Reference Architecture (RA) and Standard Technology/Framework Stack Pick a pilot application to enforce architecture rules as part of the build process (and Eclipse IDE) Incorporate architecture enforcement into other applications Training/Mentoring as part of an on-going Architecture Governance effort 56 28

Conclusions Make architecture rules part of build process to detect deviations earlier in SDLC Use enforcement check results to improve architecture/design/code (via refactoring efforts) Capture design patterns and best practices as policy enforcement Aspects Refine & refactor enforcement rules 57 AOP Tools AJDT Spring AOP MaintainJ: Sequence Diagram Using AspectJ PointcutDoctor Jexin 58 29

References (1/2) Architecture Rules Aspects Google Project ( http://code.google.com/p/architecture-rules-aspects/) AspectJ In Action (2 nd Edition) Building Software As Solid As The Pyramids (Ramnivas Laddad & Alef Arendsen) Using Aspect-Oriented Programming to Enforce Architecture (Paulo Merson) AOP In the Enterprise (Adrian Colyer) Aspects & policy injection - clean up your code Policy Injection Application Block 59 References (2/2) Structure 101 SonarJ (http://www.hello2morrow.com) Lattix Contract4J (http://www.contract4j.org/contract4j) Macker (http://innig.net/macker/) Rome - RSS Feeds Framework (https:// rome.dev.java.net/) 60 30

Contact Information Domain-Driven Design and Enterprise Architecture articles on InfoQ InfoQ website (http://www.infoq.com) E-Mail: srinipenchikala@gmail.com Blog: http://srinip2007.blogspot.com 61 Q & A 62 31

Thank You Thank you for your attention Feedback survey 63 32