SlideShare a Scribd company logo
1 of 28
How to have your
    domain-driven design cake
         and eat it, too


           Dan Haywood

            22 Feb 2010


v
About me…
       Involved with Naked Objects since 2002

       Committer to the open source framework
           lead developer of a number of sister projects

       Author,"Domain Driven Design using Naked
        Objects"
           pragmatic bookshelf


       Senior advisor to the Irish Government
           technical advisor, domain modelling
           coaching on agile development practices
v                                   Page 2
Domain Driven Design
    Ubiquitous Language




        With a conscious effort by the team, the
        domain model can provide the backbone
               for that common language
                                        Eric Evans
v                         Page 3
Roll Call
       Who's read Eric Evans' book,
        Domain-Driven design?

       Who's practicising DDD?

       Who's using an ORM?

       Who's using agile methods?

v                         Page 4
What Is Naked Objects?
       A Principle
           behaviorally complete objects

       An Architectural Pattern
           automatically renders domain objects in an OOUI

       A Framework
           Open source, extensible
           Rapid prototyping & development
           Build webapps or rich client (client/server)

       A bed-fellow for Domain-Driven Design
v                                 Page 5
Naked Objects Pattern
       Business functionality is
        encapsulated on the
        core business objects

       Objects are exposed
        directly & automatically

       All user actions consist of
           creating or retrieving objects,
           forming associations between them
           invoking actions on them
v                                 Page 6
The DRY Principle
       The UI representations
        correspond directly
        with the underlying
        domain object model

           objects and their icons
           object properties / collections
           the menu items available on an object
                eg Claim#submit(Approver)
           desktop icons with repositories / domain services
                eg ClaimRepository, EmployeeRepository


v                                     Page 7
A simple domain model...
                        0..1
             Approver
                                                 *
                                                        Claim
                               Claimant       Claim
                                                      Repository
                                          *

                                                 *
    Employee                                  Claim
                    Employee
    Repository                                Item




v
Naked Objects apps are just pojos

                        0..1
             Approver
                                                 *
                                                        Claim
                               Claimant       Claim
                                                      Repository
                                          *

                                                 *
    Employee                                  Claim
                    Employee
    Repository                                Item




v
But what does a Naked Objects
    system look like?

       Let's see...




v                      Page 10
The Naked Objects
    Programming Model

                                   • Dependency injection
              Runtime support      • Bytecode enhancements

                                   • Declarative business rules
                 Annotations       • Rendering hints

                                   • see it
                Business Rules     • use it
             through Conventions   • do it
                                   • know-whats
                Behaviorally       • know-how-tos
                 Complete          • contributed actions
                                   • Entity
                    Pojo           • Value
                                   • Repository & Services




                        Page 11
v
Naked Objects Framework




v                Page 12
Run as webapp or client/server
    Web app                    Client/server
     Context Listener to       Stateless server-side

      bootstrap NOF               architecture
     ServletFilter to setup    By default, actions

      session                     invoked server-side
     Host HTML viewer,               @ExecutedOn overrides
      Scimpi, Restful,            Remoting either via plain
      server-side remoting         sockets or http
                                  Transparent lazy loading
                                   of resources


v
Pluggable Persistence
       In-memory object store
           use composite fixtures

       XML object store
           for casual prototyping

       JPA object store
           uses Hibernate as underlying implementation
           requires @DiscriminatorValue and @Id
                to consistently support @Any associations


       SQL Object Store

       Berkeley DB Object Store
v
Pluggable Viewers
       DnD Viewer           Eclipse RCP Viewer
       HTML Viewer              in development
       Scimpi Viewer
                             Vaadin Viewer
       Headless Viewer          just started


       FitNesse             Others?
       RESTful Viewer           GWT?
                                 JavaFX?
                                 NetBeans RCP?
                                 Flex?

v
Newer viewers are / will be
    customizable




v
A detail on how to customize
                                   Claim/object-short.shtml




    using the Scimpi viewer




v
Agile acceptance testing
    using FitNesse
       Write scenario tests, without writing
        fixtures
           Act in same way as Naked Objects viewers




v
RESTful Support
       Exposes domain objects and properties
        as RESTful resources
                        Object       Property   Collection    Action
             GET     current state     n/a        current      n/a
                         of all                  contents
                      properties
             PUT        create         set       add item      n/a
            DELETE     destroy        clear     remove item    n/a
            POST         n/a           n/a         n/a        invoke

       Rendered as XHTML using CSS microlanguage
       Write client-side code using JAX-RS annotations
           JBoss RestEasy is underlying implementation`
v
RESTful XHTML Support




v
Not an all or nothing affair
        Committing to any new framework is risky
             so don't!

        Just use for prototyping and requirements elicitation
             Minimal dependencies
             Write a conventional front-end (eg Wicket)
             Map to Hibernate or other JPA technology
                  Domain model are POJOs after all

        Or, go the whole hog and deploy on Naked Objects
             either rich client or web
             use plugins for Scimpi, Rich Client Objects or DnD
             write your own viewers?

        Whichever, Naked Objects is a great way to get into
                      domain-driven design
v                                          Page 21
Multiple Deployment Options


                        Embedded             Custom              Full
    Pure Pojo           MetaModel            Presentation        Deployment
    • Use as a          • Clothe with your   • Clothe with       • NOF provides all
      development         own UI               your own UI         the layers
      tool
                        • NOF provides       • NOF handles the   • Deploy as a
    • Deploy into any     the app layer        rest                webapp
      layered
      enterprise        • Use your own                           • Deploy as
      architecture        persistence                              client/server
                          layer




v
Deployment Options

        Embedded Metamodel
    bootstrap the metamodel
    EmbeddedContext context = new MyEmbeddedContext();

    NakedObjectsMetaModel nomm =                         public class Employee … {
      new NakedObjectsMetaModel(
        context,                                             private String name;
        ClaimRepositoryInMemory.class,                       @MemberOrder(sequence="1")
        EmployeeRepositoryInMemory.class);                   @Disabled
    nakedObjectsMetaModel.init();                            public String getName() {
                                                               return name;
    either reach into the metamodel                          }
                                                             public void setName(String lastName) {
    NakedObjectSpecification employeeSpec =                    this.name = lastName;
      nomm.getSpecificationLoader()                          }
                .loadSpecification(Employee.class);          …
                                                         }
    NakedObjectAssociation nameAssoc =
    employeeSpec.getAssociation("name");
    DisabledFacet disabledFacet =
    nameAssoc.getFacet(DisabledFacet.class);

    System.out.println("Disabled: " + disabledFacet);


    or interact using headless viewer
    HeadlessViewer viewer = nomm.getViewer();

    Employee employee = new Employee();
    Employee employeeView =
      viewer.view(employee);
    employeeView.setName("Joe");
v
Domain Driven Design
    Ubiquitous Language




        With a conscious effort by the team, the
        domain model can provide the backbone
               for that common language
                                        Eric Evans
v                         Page 24
Domain Driven Design
    Ubiquitous Language




        Under Naked Objects, there is nothing to
          talk about (or with) other than the
                   domain model ...
        so the effort isn't particularly conscious
v                          Page 25
Before I forget...
                                                  Part 1 – Tools
                                                      DDD core concepts
                                                  Part 2 – Techniques
                                                      Patterns, idioms,
                                                       decoupling
                                                  Part 3 – Practices
                                                      FitNesse, Wicket,
                                                       JPA/Hibernate, RESTful &
                                                       ESBs



    www.pragprog.com/titles/dhnako                 25% discount code:
                                                   zDanHaywoodFeb2010
v                                    Page 26
and don't you forget...

             The DDD Exchange
               11 June 2010



        Please fill in your evaluations
    free entrance for one lucky person!

v                    Page 27
Further Information
                                           Perfection is finally achieved not
                                            when there's no longer anything
                                              to add, but when there's no
                                            longer anything to take away …
                                            when a body has been stripped
                                                 down to its nakedness
                                                       Antoine de Saint-Exupéry


     Contact & Resources
     dan@haywood-associates.co.uk
     www.danhaywood.com
     www.pragprog.com/titles/dhnako
     www.nakedobjects.org
     starobjects.sourceforge.net

v                                Page 28

More Related Content

What's hot

Design Patterns in iOS
Design Patterns in iOSDesign Patterns in iOS
Design Patterns in iOSYi-Shou Chen
 
Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009Viswanath J
 
A Lap Around Visual Studio 11
A Lap Around Visual Studio 11A Lap Around Visual Studio 11
A Lap Around Visual Studio 11Chad Green
 
Core Graphics & Core Animation
Core Graphics & Core AnimationCore Graphics & Core Animation
Core Graphics & Core AnimationAndreas Blick
 

What's hot (6)

Design Patterns in iOS
Design Patterns in iOSDesign Patterns in iOS
Design Patterns in iOS
 
Asif
AsifAsif
Asif
 
Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009Inside the Android application framework - Google I/O 2009
Inside the Android application framework - Google I/O 2009
 
A Lap Around Visual Studio 11
A Lap Around Visual Studio 11A Lap Around Visual Studio 11
A Lap Around Visual Studio 11
 
Java i lecture_1_upd1
Java i lecture_1_upd1Java i lecture_1_upd1
Java i lecture_1_upd1
 
Core Graphics & Core Animation
Core Graphics & Core AnimationCore Graphics & Core Animation
Core Graphics & Core Animation
 

Viewers also liked

Joomla2.0 architecture
Joomla2.0 architectureJoomla2.0 architecture
Joomla2.0 architectureHerman Peeren
 
EclipseCon 2015 - Generating business applications from executable models
EclipseCon 2015 - Generating business applications from executable modelsEclipseCon 2015 - Generating business applications from executable models
EclipseCon 2015 - Generating business applications from executable modelsRafael Chaves
 
Cloudfier business pitch deck
Cloudfier business pitch deckCloudfier business pitch deck
Cloudfier business pitch deckRafael Chaves
 
11 Dogmas of model driven development
11 Dogmas of model driven development11 Dogmas of model driven development
11 Dogmas of model driven developmentRafael Chaves
 
MDD with Executable UML Models
MDD with Executable UML ModelsMDD with Executable UML Models
MDD with Executable UML ModelsRafael Chaves
 
Model Driven Prototyping
Model Driven PrototypingModel Driven Prototyping
Model Driven PrototypingRafael Chaves
 
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutosTDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutosRafael Chaves
 
UML- Unified Modeling Language
UML- Unified Modeling LanguageUML- Unified Modeling Language
UML- Unified Modeling LanguageShahzad
 

Viewers also liked (10)

Joomla2.0 architecture
Joomla2.0 architectureJoomla2.0 architecture
Joomla2.0 architecture
 
EclipseCon 2015 - Generating business applications from executable models
EclipseCon 2015 - Generating business applications from executable modelsEclipseCon 2015 - Generating business applications from executable models
EclipseCon 2015 - Generating business applications from executable models
 
Cloudfier business pitch deck
Cloudfier business pitch deckCloudfier business pitch deck
Cloudfier business pitch deck
 
Code generation
Code generationCode generation
Code generation
 
11 Dogmas of model driven development
11 Dogmas of model driven development11 Dogmas of model driven development
11 Dogmas of model driven development
 
TextUML Toolkit
TextUML ToolkitTextUML Toolkit
TextUML Toolkit
 
MDD with Executable UML Models
MDD with Executable UML ModelsMDD with Executable UML Models
MDD with Executable UML Models
 
Model Driven Prototyping
Model Driven PrototypingModel Driven Prototyping
Model Driven Prototyping
 
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutosTDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
TDC SP 2016 - Construindo um microserviço Java 100% funcional em 30 minutos
 
UML- Unified Modeling Language
UML- Unified Modeling LanguageUML- Unified Modeling Language
UML- Unified Modeling Language
 

Similar to Dan Haywood

Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with StencilConf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with StencilTechExeter
 
IBM Mobile Foundation POT - Part 2 introduction to application development wi...
IBM Mobile Foundation POT - Part 2 introduction to application development wi...IBM Mobile Foundation POT - Part 2 introduction to application development wi...
IBM Mobile Foundation POT - Part 2 introduction to application development wi...AIP Foundation
 
Real-world Dojo Mobile
Real-world Dojo MobileReal-world Dojo Mobile
Real-world Dojo MobileAndrew Ferrier
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxGevitaChinnaiah
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React nativeDhaval Barot
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09manisoft84
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiCédric Hüsler
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better softwarematthoneycutt
 
Acceptance Testing of Web UI
Acceptance Testing of Web UIAcceptance Testing of Web UI
Acceptance Testing of Web UIVladimir Tsukur
 
Making Swift Native Modules in React Native
Making Swift Native Modules in React NativeMaking Swift Native Modules in React Native
Making Swift Native Modules in React NativeRay Deck
 
Three WEM Dev Tricks
Three WEM Dev TricksThree WEM Dev Tricks
Three WEM Dev TricksGabriel Walt
 
Getting started vmware apps
Getting started vmware appsGetting started vmware apps
Getting started vmware appsrickyelqasem
 
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDevTriple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDevWerner Keil
 
Session One Intro
Session One IntroSession One Intro
Session One Introrsnarayanan
 
Architecting & Developing On The Cloud Operating System Windows Azure V3
Architecting & Developing On The Cloud Operating System  Windows Azure  V3Architecting & Developing On The Cloud Operating System  Windows Azure  V3
Architecting & Developing On The Cloud Operating System Windows Azure V3Venkatarangan Thirumalai
 
Evolving Mobile Architectures
Evolving Mobile ArchitecturesEvolving Mobile Architectures
Evolving Mobile Architecturessgleadow
 

Similar to Dan Haywood (20)

React native
React nativeReact native
React native
 
Conf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with StencilConf 2018 Track 2 - Custom Web Elements with Stencil
Conf 2018 Track 2 - Custom Web Elements with Stencil
 
IBM Mobile Foundation POT - Part 2 introduction to application development wi...
IBM Mobile Foundation POT - Part 2 introduction to application development wi...IBM Mobile Foundation POT - Part 2 introduction to application development wi...
IBM Mobile Foundation POT - Part 2 introduction to application development wi...
 
Real-world Dojo Mobile
Real-world Dojo MobileReal-world Dojo Mobile
Real-world Dojo Mobile
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptx
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
Project Zero Php Quebec
Project Zero Php QuebecProject Zero Php Quebec
Project Zero Php Quebec
 
Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09Getting started with entity framework revised 9 09
Getting started with entity framework revised 9 09
 
Building Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGiBuilding Content Applications with JCR and OSGi
Building Content Applications with JCR and OSGi
 
Structure mapping your way to better software
Structure mapping your way to better softwareStructure mapping your way to better software
Structure mapping your way to better software
 
Acceptance Testing of Web UI
Acceptance Testing of Web UIAcceptance Testing of Web UI
Acceptance Testing of Web UI
 
Making Swift Native Modules in React Native
Making Swift Native Modules in React NativeMaking Swift Native Modules in React Native
Making Swift Native Modules in React Native
 
Three WEM Dev Tricks
Three WEM Dev TricksThree WEM Dev Tricks
Three WEM Dev Tricks
 
Spring session
Spring sessionSpring session
Spring session
 
Getting started vmware apps
Getting started vmware appsGetting started vmware apps
Getting started vmware apps
 
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDevTriple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
Triple-E’class Continuous Delivery with Hudson, Maven, Kokki and PyDev
 
Session One Intro
Session One IntroSession One Intro
Session One Intro
 
Architecting & Developing On The Cloud Operating System Windows Azure V3
Architecting & Developing On The Cloud Operating System  Windows Azure  V3Architecting & Developing On The Cloud Operating System  Windows Azure  V3
Architecting & Developing On The Cloud Operating System Windows Azure V3
 
Evolving Mobile Architectures
Evolving Mobile ArchitecturesEvolving Mobile Architectures
Evolving Mobile Architectures
 

More from Skills Matter

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard LawrenceSkills Matter
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applicationsSkills Matter
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmSkills Matter
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimSkills Matter
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Skills Matter
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlSkills Matter
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsSkills Matter
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Skills Matter
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Skills Matter
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldSkills Matter
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Skills Matter
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Skills Matter
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingSkills Matter
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveSkills Matter
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSkills Matter
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tSkills Matter
 

More from Skills Matter (20)

5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence5 things cucumber is bad at by Richard Lawrence
5 things cucumber is bad at by Richard Lawrence
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvmScala e xchange 2013 haoyi li on metascala a tiny diy jvm
Scala e xchange 2013 haoyi li on metascala a tiny diy jvm
 
Oscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheimOscar reiken jr on our success at manheim
Oscar reiken jr on our success at manheim
 
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
Progressive f# tutorials nyc dmitry mozorov & jack pappas on code quotations ...
 
Cukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberlCukeup nyc ian dees on elixir, erlang, and cucumberl
Cukeup nyc ian dees on elixir, erlang, and cucumberl
 
Cukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.jsCukeup nyc peter bell on getting started with cucumber.js
Cukeup nyc peter bell on getting started with cucumber.js
 
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
Agile testing & bdd e xchange nyc 2013 jeffrey davidson & lav pathak & sam ho...
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
Agile testing & bdd e xchange nyc 2013 gojko adzic on bond villain guide to s...
 
Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#Dmitry mozorov on code quotations code as-data for f#
Dmitry mozorov on code quotations code as-data for f#
 
A poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testingA poet's guide_to_acceptance_testing
A poet's guide_to_acceptance_testing
 
Russ miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-diveRuss miles-cloudfoundry-deep-dive
Russ miles-cloudfoundry-deep-dive
 
Serendipity-neo4j
Serendipity-neo4jSerendipity-neo4j
Serendipity-neo4j
 
Simon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelismSimon Peyton Jones: Managing parallelism
Simon Peyton Jones: Managing parallelism
 
Plug 20110217
Plug   20110217Plug   20110217
Plug 20110217
 
Lug presentation
Lug presentationLug presentation
Lug presentation
 
I went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_tI went to_a_communications_workshop_and_they_t
I went to_a_communications_workshop_and_they_t
 
Plug saiku
Plug   saikuPlug   saiku
Plug saiku
 

Recently uploaded

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Dan Haywood

  • 1. How to have your domain-driven design cake and eat it, too Dan Haywood 22 Feb 2010 v
  • 2. About me…  Involved with Naked Objects since 2002  Committer to the open source framework  lead developer of a number of sister projects  Author,"Domain Driven Design using Naked Objects"  pragmatic bookshelf  Senior advisor to the Irish Government  technical advisor, domain modelling  coaching on agile development practices v Page 2
  • 3. Domain Driven Design Ubiquitous Language With a conscious effort by the team, the domain model can provide the backbone for that common language Eric Evans v Page 3
  • 4. Roll Call  Who's read Eric Evans' book, Domain-Driven design?  Who's practicising DDD?  Who's using an ORM?  Who's using agile methods? v Page 4
  • 5. What Is Naked Objects?  A Principle  behaviorally complete objects  An Architectural Pattern  automatically renders domain objects in an OOUI  A Framework  Open source, extensible  Rapid prototyping & development  Build webapps or rich client (client/server)  A bed-fellow for Domain-Driven Design v Page 5
  • 6. Naked Objects Pattern  Business functionality is encapsulated on the core business objects  Objects are exposed directly & automatically  All user actions consist of  creating or retrieving objects,  forming associations between them  invoking actions on them v Page 6
  • 7. The DRY Principle  The UI representations correspond directly with the underlying domain object model  objects and their icons  object properties / collections  the menu items available on an object  eg Claim#submit(Approver)  desktop icons with repositories / domain services  eg ClaimRepository, EmployeeRepository v Page 7
  • 8. A simple domain model... 0..1 Approver * Claim Claimant Claim Repository * * Employee Claim Employee Repository Item v
  • 9. Naked Objects apps are just pojos 0..1 Approver * Claim Claimant Claim Repository * * Employee Claim Employee Repository Item v
  • 10. But what does a Naked Objects system look like?  Let's see... v Page 10
  • 11. The Naked Objects Programming Model • Dependency injection Runtime support • Bytecode enhancements • Declarative business rules Annotations • Rendering hints • see it Business Rules • use it through Conventions • do it • know-whats Behaviorally • know-how-tos Complete • contributed actions • Entity Pojo • Value • Repository & Services Page 11 v
  • 13. Run as webapp or client/server Web app Client/server  Context Listener to  Stateless server-side bootstrap NOF architecture  ServletFilter to setup  By default, actions session invoked server-side  Host HTML viewer,  @ExecutedOn overrides Scimpi, Restful,  Remoting either via plain server-side remoting sockets or http  Transparent lazy loading of resources v
  • 14. Pluggable Persistence  In-memory object store  use composite fixtures  XML object store  for casual prototyping  JPA object store  uses Hibernate as underlying implementation  requires @DiscriminatorValue and @Id  to consistently support @Any associations  SQL Object Store  Berkeley DB Object Store v
  • 15. Pluggable Viewers  DnD Viewer  Eclipse RCP Viewer  HTML Viewer  in development  Scimpi Viewer  Vaadin Viewer  Headless Viewer  just started  FitNesse  Others?  RESTful Viewer  GWT?  JavaFX?  NetBeans RCP?  Flex? v
  • 16. Newer viewers are / will be customizable v
  • 17. A detail on how to customize Claim/object-short.shtml using the Scimpi viewer v
  • 18. Agile acceptance testing using FitNesse  Write scenario tests, without writing fixtures  Act in same way as Naked Objects viewers v
  • 19. RESTful Support  Exposes domain objects and properties as RESTful resources Object Property Collection Action GET current state n/a current n/a of all contents properties PUT create set add item n/a DELETE destroy clear remove item n/a POST n/a n/a n/a invoke  Rendered as XHTML using CSS microlanguage  Write client-side code using JAX-RS annotations  JBoss RestEasy is underlying implementation` v
  • 21. Not an all or nothing affair  Committing to any new framework is risky  so don't!  Just use for prototyping and requirements elicitation  Minimal dependencies  Write a conventional front-end (eg Wicket)  Map to Hibernate or other JPA technology  Domain model are POJOs after all  Or, go the whole hog and deploy on Naked Objects  either rich client or web  use plugins for Scimpi, Rich Client Objects or DnD  write your own viewers? Whichever, Naked Objects is a great way to get into domain-driven design v Page 21
  • 22. Multiple Deployment Options Embedded Custom Full Pure Pojo MetaModel Presentation Deployment • Use as a • Clothe with your • Clothe with • NOF provides all development own UI your own UI the layers tool • NOF provides • NOF handles the • Deploy as a • Deploy into any the app layer rest webapp layered enterprise • Use your own • Deploy as architecture persistence client/server layer v
  • 23. Deployment Options Embedded Metamodel bootstrap the metamodel EmbeddedContext context = new MyEmbeddedContext(); NakedObjectsMetaModel nomm = public class Employee … { new NakedObjectsMetaModel( context, private String name; ClaimRepositoryInMemory.class, @MemberOrder(sequence="1") EmployeeRepositoryInMemory.class); @Disabled nakedObjectsMetaModel.init(); public String getName() { return name; either reach into the metamodel } public void setName(String lastName) { NakedObjectSpecification employeeSpec = this.name = lastName; nomm.getSpecificationLoader() } .loadSpecification(Employee.class); … } NakedObjectAssociation nameAssoc = employeeSpec.getAssociation("name"); DisabledFacet disabledFacet = nameAssoc.getFacet(DisabledFacet.class); System.out.println("Disabled: " + disabledFacet); or interact using headless viewer HeadlessViewer viewer = nomm.getViewer(); Employee employee = new Employee(); Employee employeeView = viewer.view(employee); employeeView.setName("Joe"); v
  • 24. Domain Driven Design Ubiquitous Language With a conscious effort by the team, the domain model can provide the backbone for that common language Eric Evans v Page 24
  • 25. Domain Driven Design Ubiquitous Language Under Naked Objects, there is nothing to talk about (or with) other than the domain model ... so the effort isn't particularly conscious v Page 25
  • 26. Before I forget...  Part 1 – Tools  DDD core concepts  Part 2 – Techniques  Patterns, idioms, decoupling  Part 3 – Practices  FitNesse, Wicket, JPA/Hibernate, RESTful & ESBs www.pragprog.com/titles/dhnako 25% discount code: zDanHaywoodFeb2010 v Page 26
  • 27. and don't you forget... The DDD Exchange 11 June 2010 Please fill in your evaluations free entrance for one lucky person! v Page 27
  • 28. Further Information Perfection is finally achieved not when there's no longer anything to add, but when there's no longer anything to take away … when a body has been stripped down to its nakedness Antoine de Saint-Exupéry Contact & Resources dan@haywood-associates.co.uk www.danhaywood.com www.pragprog.com/titles/dhnako www.nakedobjects.org starobjects.sourceforge.net v Page 28