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

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Recently uploaded (20)

Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

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