SlideShare a Scribd company logo
1 of 65
Domain Driven Design &
Development with Spring Portfolio



            Srini Penchikala
       Ann Arbor Java User Group
           February 24, 2009
About the Speaker
• Enterprise Architect
• Writer: InfoQ, TSS, ONJava, DevX Java, java.net
• Speaker
• Detroit Java User Group Leader
• Using Java/JEE since 2000
• SOA/Web Services since 2006
• PowerPoint since September 2008


                                                    2
Presentation Goal




 “What” Domain Driven Design (DDD) is and “How”
 Spring Portfolio helps in implementing a DDD project



                                                        3
Format
    Interactive



    Demos



    Duration: ~45 minutes



    Q&A





                            4
Before we start…




• How many have heard of Domain Driven Design before?
• How many are currently using DDD?



                                                        5
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               6
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               7
Layered Architecture Diagram




                               8
Architecture Layers
    User Interface



    Application



    Domain



    Infrastructure





                      9
Domain Layer
    Represents concepts of business,


    information about business situation, and
    business rules.
    Maintains state reflecting the business


    situation.
    This layer is the heart of business


    software*.


                                                10
J2EE Architecture Model
                                      HTTP
   Application       Controller
                                      Session Management




                                      Transaction Management
                      Facade
                                      Caching




   Data Access   Data Access Object




   Persistence    Domain Object
                              *
                                                     Notes:
                                                     •     No real Domain Layer
                                                     •     Business Logic in Façade Layer  (Stateless
                                                           Session Beans  )
                                                     •     Direct Access to Data Access Objects
                                                           (CRUD logic is infrastructure not business
                                                                                                    )
                                                     •     *Domain objects are really Persistence
   Data Store                                              classes with getters
                                                                              /setters
                     Database                        •     Infrastructure concerns have overtaken/
                                                           overshadowed the domain concerns
                                                                                                        11
The Problem
    Architects/Developers are thinking only about



    infrastructure.
    Most of the development time is still spent on



    writing plumbing code instead of real business
    logic.
    We have lost real OOP





                                                    12
Domain Driven Architecture




                             13
Domain Driven Design &
Development




                         14
Domain Driven Design
What:
  Domain Driven Design (DDD) is about


  mapping business domain concepts into
  software artifacts.
Why:
  To create better software by focusing on a


  model of the domain rather than the
  technology.

                                               15
Domain Driven Design
    Is not a:



        new technology
    


        new framework
    


        JSR standard
    



    Is a:



        design pattern
    




                         16
Advantages
    Promotes high cohesion and low coupling


    in the application code
    Easy to test domain components



    Business (domain) logic is isolated from


    non-domain and infrastructure code
    Adding/changing services does not


    influence the domain or other services.


                                               17
Development Styles
    Transaction Script



    Table Module



    Domain Model





                         18
Development Styles
    A single instance that handles the
•

    business logic for all rows in a database
    table or view.




Choose the right style for the right application/service


Source: Patterns of Enterprise Application Architecture, Martin Fowler   19
DDD Manifesto
(Business) Domain             Infrastructure
    Domain State & Behavior       Persistence
                             



    Business Logic                Transaction Management
                             



    Business Rules                Remoting
                             



                                  Scheduling
                              




                                                           20
Domain Objects
    Domain objects are instances of real


    entities which hold any knowledge or
    activity of the business domain.




                                           21
Main Elements
    Entities



        Objects defined by their identity, which remains
    


        same throughout the life of software
    Value Objects



        Immutable objects that have no identity & are used
    


        to describe an attribute of another object.
    (Domain) Services



        Objects that have no state & only have a defined
    


        behavior that’s not part of any domain object.
                                                           22
Other Elements

    Module:



        A method of organizing related concepts and tasks
    


        in order to reduce complexity.
    Domain object Lifecycle is managed by:



        Aggregate
    


        Factory
    


        Repository
    




                                                        23
DDD Thought Process
    Start with domain entities and domain logic



        Basic domain-driven & object-oriented principles
    



    Mentally start without a quot;servicequot; layer



        See how far you can get
    


        Add service level as required
    



    You can refactor to DDD





Source: Domain Driven Design with AOP and DI, Presentation by
Ramnivas Laddad                                                 24
DDD Lifecycle Diagram




                        25
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               26
Spring Framework
• Separation of concerns (business v.
  infrastructure)
• POJO Based Design
• Business domain first, infrastructure concerns
  second
• Agile Development and Testing



                                               27
Spring Philosophy




                    28
Spring Portfolio
    Spring Core



    Spring AOP



    Spring Security



    Spring MVC/Spring WebFlow





                                29
The Project
    Project Management



        Agile Methodology (SCRUM)
    


        Iterative Design, Development, Unit Testing and
    


        Refactoring.
    Architecture



        Focus on business domain & alignment with
    


        business model
        Isolation & Modularity
    


        Loosely coupled with other layers
    

                                                          30
        POJO programming model.
    
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               31
Design Recipe
    Object Oriented Programming (OOP)



    Dependency Injection (DI)



    Aspect-oriented Programming (AOP)



    Annotations





                                        32
DDD with OOP Principles
   Domain Element           State/Behavior

Entity, Value Object,   State and Behavior
Aggregate
Data Transfer Object    State only

Service, Repository     Behavior only


                                             33
Dependency Injection
• Decouple and manage the dependencies of
  the components in the application
• DI Frameworks:
  • Spring
  • Google Guice
  • Pico Container



                                            34
DI Use Cases
    Service



        Domain Classes
    


        Transaction Manager
    


    Domain



        Data Access Object (DAO)
    


    DAO class



        Data Source
    


        JPA Entity Manager
    



                                   35
Domain Object DI
• @Configurable annotation




                             36
Aspect-oriented Programming
• Allows developers to add behavior to objects
  in a non-obtrusive manner through use of
  static and dynamic crosscutting.
• Main goal is to code cross-cutting concerns in
  separate modules and apply them in a
  declarative way.


                                               37
AOP Use Cases
    Framework Built-In Aspects


        Transaction Management
    


        Security
    




    Custom Aspects


        Profiling
    


        Caching
    


        Rules
    




                                 38
Annotations
• Added in Java SE 5.0 as Java Metadata
  facility (JSR 175).
• Provide a way to add metadata to program
  elements.
• Defined by nearly every recent JSR standard.
• Also include a mechanism for adding custom
  annotations to the Java code*.

                                             39
Annotations For Domain Elements
   Layer    Domain Element    Annotation
Domain
            Entity,          @Entity (JPA),
            Value Object     @Configurable
Domain      Repository       @Repository
Domain      Service          @Service
Application Controller       @Controller
All         All              @Component
                                           40
Custom Annotations Use Cases
• Caching
• Validation




                               41
Custom Annotations
• Implementation Options
  •   Reflection
  •   Annotation Processing Tool (APT)
  •   Byte-code Instrumentation (Javassist)
  •   Aspects/AOP (AspectJ and Spring AOP)




                                              42
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               43
Domain Aspects
    Data Access



    Persistence



    Transaction Management



    Domain Security



    Business Operation Retry



    Caching





                               44
Persistence & Txn Management
    JDBC




    JPA w/ Hibernate, OpenJPA, EclipseLink



    (TopLink)
    Spring JPA Utils & Data Source DI




    Spring JTA Support



       –   Transactions are managed in Service classes
           using quot;@Transactionalquot; annotation

                                                     45
Spring Security
    Declarative Application Security support




    Fits in very well with Spring Framework



          Authentication
      


          Authorization
      


              URL level
          


              Domain Object
          


              Service Method
          




                                               46
DEMO




       47
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               48
Architecture Enforcement
• Domain Driven Design Rules
• Enforcement using Aspects and AOP




                                      49
Rules – Compile Time
    Service classes should not depend on



    Application layer classes
    DAO classes should only be called from



    Domain classes




                                             50
DEMO




       51
Rules – Run Time
    Business operation retry




    Caching



        System Settings (using AOP)
    


        Application Variables/Business Data (using
    


        Annotations)




                                                     52
DEMO




       53
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               54
Code Generation
Write:
     XSD
 


     Domain / Service
 


Code Generate:
     DAO interface and implementation
 


     Facade (EJB's & WebServices)
 


     DTO's
 


     Unit Tests (including test data)
 


     Spring configuration files
 

                                        55
Code Generation Tools
    openArchitectureWare (oAW)




    AndroMDA




    Aceleo Spring Module




    Skyway Builder





                                 56
DEMO




       57
Tools
    Spring for:



        Scheduling (Quartz)
    


        Configuration Management (Commons
    


        Configuration, JMX)
    Hibernate Tools (for DDL generation)




    Dozer (DO/DTO Assembly)





                                            58
DDD Lifecycle Diagram Revisited




                                  59
Agenda
•   Domain Driven Design & Development
•   Spring Portfolio
•   Dependency Injection / AOP / Annotations
•   Spring Security (Demo)
•   Architecture Enforcement (Demo)
•   Code Generation (Demo)
•   Conclusions


                                               60
Conclusions
• Domain First, Infrastructure Second
• Layered Architecture & Separation of Concerns
• Always keep the quot;contextquot; in mind
• Balance between the quot;rightquot; vs. the quot;right nowquot;
• Upcoming Java/JEE releases focus on development
  & deployment simplicity
• Spring 3.0, Java EE 6, JPA 2.0, EJB 3.1


                                                    61
References
• Domain Driven Design and Development In Practice
  (http://www.infoq.com/articles/ddd-in-practice)
• Domain-Driven Design Website
  (http://www.domaindrivendesign.org/)
• Domain-Driven Design by Eric Evans
• Applying Domain-Driven Design and Patterns, Jimmy
  Nilsson
• Patterns of Enterprise Application Architecture, Martin
  Fowler
• Can DDD be Adequately Implemented Without DI and
  AOP (http://www.infoq.com/news/2008/02/ddd-di-aop)
                                                            62
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




                                                     63
Q&A




      64
Thank You
• Thank you for your attention
• Feedback survey




                                 65

More Related Content

What's hot

컴퓨터 네트워크와 인터넷
컴퓨터 네트워크와 인터넷컴퓨터 네트워크와 인터넷
컴퓨터 네트워크와 인터넷중선 곽
 
Web accessibility workshop 1
Web accessibility workshop 1Web accessibility workshop 1
Web accessibility workshop 1Vladimir Tomberg
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing ArchitecturesVictor Rentea
 
Data Modeling and Relational to NoSQL
 Data Modeling and Relational to NoSQL  Data Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQL DATAVERSITY
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignYoung-Ho Cho
 
2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices
2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices
2019 06-12-aws taipei summit-dev day-essential capabilities behind microservicesKim Kao
 
Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10Ganesan Narayanasamy
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdfBernardDeffarges
 
Taller Redis
Taller RedisTaller Redis
Taller Redisbetabeers
 
Introducción a arquitecturas y herramientas de Big Data.pdf
Introducción a arquitecturas y herramientas de Big Data.pdfIntroducción a arquitecturas y herramientas de Big Data.pdf
Introducción a arquitecturas y herramientas de Big Data.pdfVernicaPaulinaChimbo
 
DevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDDevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDGregory Boissinot
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#Aditya Kumar Rajan
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesAndreas Enbohm
 
Role-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4jRole-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4jNeo4j
 

What's hot (20)

Solid Principle
Solid PrincipleSolid Principle
Solid Principle
 
컴퓨터 네트워크와 인터넷
컴퓨터 네트워크와 인터넷컴퓨터 네트워크와 인터넷
컴퓨터 네트워크와 인터넷
 
Web accessibility workshop 1
Web accessibility workshop 1Web accessibility workshop 1
Web accessibility workshop 1
 
Vertical Slicing Architectures
Vertical Slicing ArchitecturesVertical Slicing Architectures
Vertical Slicing Architectures
 
Data Modeling and Relational to NoSQL
 Data Modeling and Relational to NoSQL  Data Modeling and Relational to NoSQL
Data Modeling and Relational to NoSQL
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices
2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices
2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices
 
Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10
 
Démystifions le Domain Driven Design
 Démystifions le Domain Driven Design Démystifions le Domain Driven Design
Démystifions le Domain Driven Design
 
Akka-intro-training-public.pdf
Akka-intro-training-public.pdfAkka-intro-training-public.pdf
Akka-intro-training-public.pdf
 
NoSql
NoSqlNoSql
NoSql
 
Taller Redis
Taller RedisTaller Redis
Taller Redis
 
Introducción a arquitecturas y herramientas de Big Data.pdf
Introducción a arquitecturas y herramientas de Big Data.pdfIntroducción a arquitecturas y herramientas de Big Data.pdf
Introducción a arquitecturas y herramientas de Big Data.pdf
 
DevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDDDevDay2017 ESGI Essential DDD
DevDay2017 ESGI Essential DDD
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
 
Domain Driven Design 101
Domain Driven Design 101Domain Driven Design 101
Domain Driven Design 101
 
Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK.v1.0.20191009
Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK.v1.0.20191009Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK.v1.0.20191009
Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK.v1.0.20191009
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Graphql
GraphqlGraphql
Graphql
 
Role-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4jRole-Based Access Control (RBAC) in Neo4j
Role-Based Access Control (RBAC) in Neo4j
 

Viewers also liked

A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slidesthinkddd
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Alan Christensen
 
Refactoring for Domain Driven Design
Refactoring for Domain Driven DesignRefactoring for Domain Driven Design
Refactoring for Domain Driven DesignDavid Berliner
 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravelwajrcs
 
Common Mechanical Engineering Terms
Common Mechanical Engineering TermsCommon Mechanical Engineering Terms
Common Mechanical Engineering TermsBinh Vo
 
Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)Lee Trout
 
Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011thinkddd
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatiasapientindia
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven DesignÜrgo Ringo
 
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices  - Austin API MeetupApplying Domain-Driven Design to APIs and Microservices  - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices - Austin API MeetupLaunchAny
 
Singleton Object Management
Singleton Object ManagementSingleton Object Management
Singleton Object Managementppd1961
 
Erlang factory layered architecture - final
Erlang factory   layered architecture - finalErlang factory   layered architecture - final
Erlang factory layered architecture - finalDennis Docter
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Scott Wlaschin
 
Node.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir BakışNode.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir BakışMustafa Dağdelen
 

Viewers also liked (20)

A Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation SlidesA Practical Guide to Domain Driven Design: Presentation Slides
A Practical Guide to Domain Driven Design: Presentation Slides
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 
Agile Yaklaşımlar
Agile YaklaşımlarAgile Yaklaşımlar
Agile Yaklaşımlar
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 
Refactoring for Domain Driven Design
Refactoring for Domain Driven DesignRefactoring for Domain Driven Design
Refactoring for Domain Driven Design
 
Event storming recipes
Event storming recipesEvent storming recipes
Event storming recipes
 
Domain Driven Design using Laravel
Domain Driven Design using LaravelDomain Driven Design using Laravel
Domain Driven Design using Laravel
 
Common Mechanical Engineering Terms
Common Mechanical Engineering TermsCommon Mechanical Engineering Terms
Common Mechanical Engineering Terms
 
Homeschooling 5 años
Homeschooling 5 añosHomeschooling 5 años
Homeschooling 5 años
 
Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)Hipster JS: Angular & Firebase (Tri-JS Meetup)
Hipster JS: Angular & Firebase (Tri-JS Meetup)
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011Domain Driven Design - DDDSydney 2011
Domain Driven Design - DDDSydney 2011
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices  - Austin API MeetupApplying Domain-Driven Design to APIs and Microservices  - Austin API Meetup
Applying Domain-Driven Design to APIs and Microservices - Austin API Meetup
 
Singleton Object Management
Singleton Object ManagementSingleton Object Management
Singleton Object Management
 
Erlang factory layered architecture - final
Erlang factory   layered architecture - finalErlang factory   layered architecture - final
Erlang factory layered architecture - final
 
Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013Domain Driven Design with the F# type System -- NDC London 2013
Domain Driven Design with the F# type System -- NDC London 2013
 
Unit 3 machines
Unit 3 machines Unit 3 machines
Unit 3 machines
 
Node.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir BakışNode.js'e Hızlı Bir Bakış
Node.js'e Hızlı Bir Bakış
 

Similar to Domain Driven Design Development Spring Portfolio

Aras ALM Workshop for PLM Configuration Management
Aras ALM Workshop for PLM Configuration ManagementAras ALM Workshop for PLM Configuration Management
Aras ALM Workshop for PLM Configuration ManagementAras
 
[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process Models[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process ModelsCarles Farré
 
From Requirements Management to Release with Git for Android System
From Requirements Management to Release with Git for Android System From Requirements Management to Release with Git for Android System
From Requirements Management to Release with Git for Android System Intland Software GmbH
 
Zen and Enterprise Architecture
Zen and Enterprise ArchitectureZen and Enterprise Architecture
Zen and Enterprise ArchitectureRichard Green
 
Are good SharePoint solutions only a myth?
Are good SharePoint solutions only a myth?Are good SharePoint solutions only a myth?
Are good SharePoint solutions only a myth?Adis Jugo
 
Novidades natural e adabas
Novidades natural e adabasNovidades natural e adabas
Novidades natural e adabasSoftware AG
 
Segundo Semario de SharePoint en Mexico por Joel Oleson
Segundo Semario de SharePoint en Mexico por Joel OlesonSegundo Semario de SharePoint en Mexico por Joel Oleson
Segundo Semario de SharePoint en Mexico por Joel OlesonJoel Oleson
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Futureelliando dias
 
Best Practices Europe 10 Steps To Successful Deployments
Best Practices Europe 10 Steps To Successful DeploymentsBest Practices Europe 10 Steps To Successful Deployments
Best Practices Europe 10 Steps To Successful DeploymentsJoel Oleson
 
Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009Srini Penchikala
 
Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009guest2b8cd
 
Felipe Rodrigues Ddd The Way Back To Oo
Felipe Rodrigues Ddd The Way Back To OoFelipe Rodrigues Ddd The Way Back To Oo
Felipe Rodrigues Ddd The Way Back To Oodeimos
 
App301 Implement a Data Access Layer with Ent Lib
App301 Implement a Data Access Layer with Ent LibApp301 Implement a Data Access Layer with Ent Lib
App301 Implement a Data Access Layer with Ent Libmcgurk
 
Aras Innovator PLM Deployment Methodology
Aras Innovator PLM Deployment MethodologyAras Innovator PLM Deployment Methodology
Aras Innovator PLM Deployment MethodologyAras
 
Refactoring Ruby on Rails Applications
Refactoring Ruby on Rails ApplicationsRefactoring Ruby on Rails Applications
Refactoring Ruby on Rails ApplicationsJonathan Weiss
 
Jee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule FinancialJee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule FinancialRule_Financial
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementInside Analysis
 

Similar to Domain Driven Design Development Spring Portfolio (20)

Aras ALM Workshop for PLM Configuration Management
Aras ALM Workshop for PLM Configuration ManagementAras ALM Workshop for PLM Configuration Management
Aras ALM Workshop for PLM Configuration Management
 
[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process Models[DSBW Spring 2009] Unit 03: WebEng Process Models
[DSBW Spring 2009] Unit 03: WebEng Process Models
 
From Requirements Management to Release with Git for Android System
From Requirements Management to Release with Git for Android System From Requirements Management to Release with Git for Android System
From Requirements Management to Release with Git for Android System
 
Zen and Enterprise Architecture
Zen and Enterprise ArchitectureZen and Enterprise Architecture
Zen and Enterprise Architecture
 
Are good SharePoint solutions only a myth?
Are good SharePoint solutions only a myth?Are good SharePoint solutions only a myth?
Are good SharePoint solutions only a myth?
 
Novidades natural e adabas
Novidades natural e adabasNovidades natural e adabas
Novidades natural e adabas
 
Segundo Semario de SharePoint en Mexico por Joel Oleson
Segundo Semario de SharePoint en Mexico por Joel OlesonSegundo Semario de SharePoint en Mexico por Joel Oleson
Segundo Semario de SharePoint en Mexico por Joel Oleson
 
Model Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & FutureModel Driven Architecture (MDA): Motivations, Status & Future
Model Driven Architecture (MDA): Motivations, Status & Future
 
Bynet2.3 Adobe Flex builder 4
Bynet2.3 Adobe Flex builder 4Bynet2.3 Adobe Flex builder 4
Bynet2.3 Adobe Flex builder 4
 
Best Practices Europe 10 Steps To Successful Deployments
Best Practices Europe 10 Steps To Successful DeploymentsBest Practices Europe 10 Steps To Successful Deployments
Best Practices Europe 10 Steps To Successful Deployments
 
Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009
 
Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009Architecture Enforcement Aspects Itarc2009
Architecture Enforcement Aspects Itarc2009
 
Felipe Rodrigues Ddd The Way Back To Oo
Felipe Rodrigues Ddd The Way Back To OoFelipe Rodrigues Ddd The Way Back To Oo
Felipe Rodrigues Ddd The Way Back To Oo
 
App301 Implement a Data Access Layer with Ent Lib
App301 Implement a Data Access Layer with Ent LibApp301 Implement a Data Access Layer with Ent Lib
App301 Implement a Data Access Layer with Ent Lib
 
Aras Innovator PLM Deployment Methodology
Aras Innovator PLM Deployment MethodologyAras Innovator PLM Deployment Methodology
Aras Innovator PLM Deployment Methodology
 
Methodology
MethodologyMethodology
Methodology
 
Refactoring Ruby on Rails Applications
Refactoring Ruby on Rails ApplicationsRefactoring Ruby on Rails Applications
Refactoring Ruby on Rails Applications
 
Jee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule FinancialJee design patterns- Marek Strejczek - Rule Financial
Jee design patterns- Marek Strejczek - Rule Financial
 
2009-dec-10 Architectuur en HL7
2009-dec-10 Architectuur en HL72009-dec-10 Architectuur en HL7
2009-dec-10 Architectuur en HL7
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data Management
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Domain Driven Design Development Spring Portfolio

  • 1. Domain Driven Design & Development with Spring Portfolio Srini Penchikala Ann Arbor Java User Group February 24, 2009
  • 2. About the Speaker • Enterprise Architect • Writer: InfoQ, TSS, ONJava, DevX Java, java.net • Speaker • Detroit Java User Group Leader • Using Java/JEE since 2000 • SOA/Web Services since 2006 • PowerPoint since September 2008 2
  • 3. Presentation Goal “What” Domain Driven Design (DDD) is and “How” Spring Portfolio helps in implementing a DDD project 3
  • 4. Format Interactive  Demos  Duration: ~45 minutes  Q&A  4
  • 5. Before we start… • How many have heard of Domain Driven Design before? • How many are currently using DDD? 5
  • 6. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 6
  • 7. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 7
  • 9. Architecture Layers User Interface  Application  Domain  Infrastructure  9
  • 10. Domain Layer Represents concepts of business,  information about business situation, and business rules. Maintains state reflecting the business  situation. This layer is the heart of business  software*. 10
  • 11. J2EE Architecture Model HTTP Application Controller Session Management Transaction Management Facade Caching Data Access Data Access Object Persistence Domain Object * Notes: • No real Domain Layer • Business Logic in Façade Layer (Stateless Session Beans ) • Direct Access to Data Access Objects (CRUD logic is infrastructure not business ) • *Domain objects are really Persistence Data Store classes with getters /setters Database • Infrastructure concerns have overtaken/ overshadowed the domain concerns 11
  • 12. The Problem Architects/Developers are thinking only about  infrastructure. Most of the development time is still spent on  writing plumbing code instead of real business logic. We have lost real OOP  12
  • 14. Domain Driven Design & Development 14
  • 15. Domain Driven Design What: Domain Driven Design (DDD) is about  mapping business domain concepts into software artifacts. Why: To create better software by focusing on a  model of the domain rather than the technology. 15
  • 16. Domain Driven Design Is not a:  new technology  new framework  JSR standard  Is a:  design pattern  16
  • 17. Advantages Promotes high cohesion and low coupling  in the application code Easy to test domain components  Business (domain) logic is isolated from  non-domain and infrastructure code Adding/changing services does not  influence the domain or other services. 17
  • 18. Development Styles Transaction Script  Table Module  Domain Model  18
  • 19. Development Styles A single instance that handles the • business logic for all rows in a database table or view. Choose the right style for the right application/service Source: Patterns of Enterprise Application Architecture, Martin Fowler 19
  • 20. DDD Manifesto (Business) Domain Infrastructure Domain State & Behavior Persistence   Business Logic Transaction Management   Business Rules Remoting   Scheduling  20
  • 21. Domain Objects Domain objects are instances of real  entities which hold any knowledge or activity of the business domain. 21
  • 22. Main Elements Entities  Objects defined by their identity, which remains  same throughout the life of software Value Objects  Immutable objects that have no identity & are used  to describe an attribute of another object. (Domain) Services  Objects that have no state & only have a defined  behavior that’s not part of any domain object. 22
  • 23. Other Elements Module:  A method of organizing related concepts and tasks  in order to reduce complexity. Domain object Lifecycle is managed by:  Aggregate  Factory  Repository  23
  • 24. DDD Thought Process Start with domain entities and domain logic  Basic domain-driven & object-oriented principles  Mentally start without a quot;servicequot; layer  See how far you can get  Add service level as required  You can refactor to DDD  Source: Domain Driven Design with AOP and DI, Presentation by Ramnivas Laddad 24
  • 26. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 26
  • 27. Spring Framework • Separation of concerns (business v. infrastructure) • POJO Based Design • Business domain first, infrastructure concerns second • Agile Development and Testing 27
  • 29. Spring Portfolio Spring Core  Spring AOP  Spring Security  Spring MVC/Spring WebFlow  29
  • 30. The Project Project Management  Agile Methodology (SCRUM)  Iterative Design, Development, Unit Testing and  Refactoring. Architecture  Focus on business domain & alignment with  business model Isolation & Modularity  Loosely coupled with other layers  30 POJO programming model. 
  • 31. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 31
  • 32. Design Recipe Object Oriented Programming (OOP)  Dependency Injection (DI)  Aspect-oriented Programming (AOP)  Annotations  32
  • 33. DDD with OOP Principles Domain Element State/Behavior Entity, Value Object, State and Behavior Aggregate Data Transfer Object State only Service, Repository Behavior only 33
  • 34. Dependency Injection • Decouple and manage the dependencies of the components in the application • DI Frameworks: • Spring • Google Guice • Pico Container 34
  • 35. DI Use Cases Service  Domain Classes  Transaction Manager  Domain  Data Access Object (DAO)  DAO class  Data Source  JPA Entity Manager  35
  • 36. Domain Object DI • @Configurable annotation 36
  • 37. Aspect-oriented Programming • Allows developers to add behavior to objects in a non-obtrusive manner through use of static and dynamic crosscutting. • Main goal is to code cross-cutting concerns in separate modules and apply them in a declarative way. 37
  • 38. AOP Use Cases Framework Built-In Aspects  Transaction Management  Security  Custom Aspects  Profiling  Caching  Rules  38
  • 39. Annotations • Added in Java SE 5.0 as Java Metadata facility (JSR 175). • Provide a way to add metadata to program elements. • Defined by nearly every recent JSR standard. • Also include a mechanism for adding custom annotations to the Java code*. 39
  • 40. Annotations For Domain Elements Layer Domain Element Annotation Domain Entity, @Entity (JPA), Value Object @Configurable Domain Repository @Repository Domain Service @Service Application Controller @Controller All All @Component 40
  • 41. Custom Annotations Use Cases • Caching • Validation 41
  • 42. Custom Annotations • Implementation Options • Reflection • Annotation Processing Tool (APT) • Byte-code Instrumentation (Javassist) • Aspects/AOP (AspectJ and Spring AOP) 42
  • 43. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 43
  • 44. Domain Aspects Data Access  Persistence  Transaction Management  Domain Security  Business Operation Retry  Caching  44
  • 45. Persistence & Txn Management JDBC  JPA w/ Hibernate, OpenJPA, EclipseLink  (TopLink) Spring JPA Utils & Data Source DI  Spring JTA Support  – Transactions are managed in Service classes using quot;@Transactionalquot; annotation 45
  • 46. Spring Security Declarative Application Security support  Fits in very well with Spring Framework  Authentication  Authorization  URL level  Domain Object  Service Method  46
  • 47. DEMO 47
  • 48. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 48
  • 49. Architecture Enforcement • Domain Driven Design Rules • Enforcement using Aspects and AOP 49
  • 50. Rules – Compile Time Service classes should not depend on  Application layer classes DAO classes should only be called from  Domain classes 50
  • 51. DEMO 51
  • 52. Rules – Run Time Business operation retry  Caching  System Settings (using AOP)  Application Variables/Business Data (using  Annotations) 52
  • 53. DEMO 53
  • 54. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 54
  • 55. Code Generation Write: XSD  Domain / Service  Code Generate: DAO interface and implementation  Facade (EJB's & WebServices)  DTO's  Unit Tests (including test data)  Spring configuration files  55
  • 56. Code Generation Tools openArchitectureWare (oAW)  AndroMDA  Aceleo Spring Module  Skyway Builder  56
  • 57. DEMO 57
  • 58. Tools Spring for:  Scheduling (Quartz)  Configuration Management (Commons  Configuration, JMX) Hibernate Tools (for DDL generation)  Dozer (DO/DTO Assembly)  58
  • 59. DDD Lifecycle Diagram Revisited 59
  • 60. Agenda • Domain Driven Design & Development • Spring Portfolio • Dependency Injection / AOP / Annotations • Spring Security (Demo) • Architecture Enforcement (Demo) • Code Generation (Demo) • Conclusions 60
  • 61. Conclusions • Domain First, Infrastructure Second • Layered Architecture & Separation of Concerns • Always keep the quot;contextquot; in mind • Balance between the quot;rightquot; vs. the quot;right nowquot; • Upcoming Java/JEE releases focus on development & deployment simplicity • Spring 3.0, Java EE 6, JPA 2.0, EJB 3.1 61
  • 62. References • Domain Driven Design and Development In Practice (http://www.infoq.com/articles/ddd-in-practice) • Domain-Driven Design Website (http://www.domaindrivendesign.org/) • Domain-Driven Design by Eric Evans • Applying Domain-Driven Design and Patterns, Jimmy Nilsson • Patterns of Enterprise Application Architecture, Martin Fowler • Can DDD be Adequately Implemented Without DI and AOP (http://www.infoq.com/news/2008/02/ddd-di-aop) 62
  • 63. 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 63
  • 64. Q&A 64
  • 65. Thank You • Thank you for your attention • Feedback survey 65