SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Domain driven web applications made simple
                   IIMS Seminar March 21st 2012
                   Associate Professor David Parsons
   The „Naked Objects‟ pattern was originally
    described by Richard Pawson in his PhD
    thesis
    ◦ Based on earlier work on „Expressive Systems‟
   3 principles:
    1. Business logic should be encapsulated in domain
       objects
    2. The user interface should be a direct
       representation of the domain objects
    3. The user interface should be automatically
       generated from the definition of the domain
       objects


                                                         2
   A faster development cycle
    ◦ There are fewer layers of code to develop
   Greater agility
    ◦ Easier to accommodate future changes in business
      requirements
   A more empowering style of user interface
    ◦ Direct interaction with the domain
   Easier requirements analysis
    ◦ Common domain understanding




                                                         3
“an expressive
system has a „make
it so‟ button”
            ◦ - Richard Pawson




                                 4
   As   1960s   high level languages?
   As   1970s   rapid application development?
   As   1980s   4GLs?
   As   1990s   visual programming?
   As   2000s   web frameworks?




                                                  5
6
   Isn‟t what it
    used to be…




                    7
   A whole bunch of web apps are basically just
    create/read/update/delete (CRUD)
    ◦   Facebook
    ◦   Twitter
    ◦   On-line banking
    ◦   Google Docs
    ◦   YouTube
    ◦   Flickr
    ◦   …
   I could go on, you get the point…


                                                   8
   A simple CRUD application involves four
    views for each domain concept
    ◦   Creating
    ◦   Editing (update/delete)
    ◦   Listing many items (read)
    ◦   Showing single item details (read)
   n entities = 4*n pages
   These views are all very much the same apart
    from the fields being exposed
   Useful if a framework can build these views
    automatically


                                                   9
   Over the last decade or so, the naked objects
    pattern has appeared in a number of tools
   Grails (a Groovy web framework) is one of
    these….




                                                    10
   A dynamic language, compiled to Java
    bytecode, to run on a Java virtual machine
   Uses a Java-like syntax
   Interoperates with other Java code and
    libraries
   Most Java code is also syntactically valid
    Groovy
   Groovy implicitly generates data access
    operations on domain objects


                                                 11
   Grails (formerly Groovy on Rails) is an open
    source web framework built on Spring using
    the Groovy language
    ◦ Spring is a Java web framework that uses other
      frameworks
   Grails takes its architectural style from Ruby
    on Rails
   You can also find this style in other tools
    such as Scala Lift



                                                       12
   Grails includes everything you need
   Integrates several common libraries and
    frameworks
   Developers can focus on business logic rather
    than integration
   You don‟t have to manually glue all the
    different components together




                                                    13
   Grails is based on Spring in order to reuse
    some core services
   Spring uses dependency Injection, a specific
    type of Inversion of Control
   The framework can inject capabilities into
    objects that follow certain rules of coding
   Think of it as being like different lightbulbs
    that have the same fitting




                                                     14
   Execution of repetitive tasks by the
    framework
   Use of scaffolding
   The framework generates artifacts related to
    repetitive tasks
    ◦ views and controllers
   Repetitive tasks are gone
   Developer customizes the artifacts




                                                   15
   You don‟t need configuration files if
    everything is in place
   Grails stipulates conventions that make
    configuration files unnecessary
    ◦ e.g. every controller is stored in a specific directory
   Probably the only configuration file you‟ll
    need will be the one which is for database
    access




                                                                16
   The Boating Lake Management System
    ◦ Captain Bob runs a business hiring out rowing
      boats on boating lakes
    ◦ He wants a system to help him manage his thriving
      business
    ◦ Two of the key concepts in the system are Rowing
      Boat and Lake
    ◦ There is a one to many relationship between them
      (one lake can have many rowing boats)

   Demo uses the SpringSource Toolsuite for
    Grails development


                                                          17
   This is a domain class
   We add a few properties and a relationship (to
    one other object)




                                                     18
   This is also a domain class
   Again we add a few properties and a
    relationship (to many other objects)




                                           19
   e.g. for the Rowing Boat



   To make the controller and views dynamic,
    use a scaffold in the controllers




                                                20
   Web app to go
    ◦ („prod run-app‟ would also persist the data in the
      database)




                                                           21
   Easy to add validation, field ordering and
    visibility, formatting, style sheets etc.
   Most tasks driven from within the domain
    objects
   For further info see http://grails.org/




                                                 22

Más contenido relacionado

Similar a Naked Objects and Groovy Grails

Lecture android best practices
Lecture   android best practicesLecture   android best practices
Lecture android best practices
eleksdev
 
GR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting GrailsGR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting Grails
GR8Conf
 
Adopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf EuropeAdopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf Europe
KlausBaumecker
 

Similar a Naked Objects and Groovy Grails (20)

Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)
 
A Tour of Ruby On Rails
A Tour of Ruby On RailsA Tour of Ruby On Rails
A Tour of Ruby On Rails
 
Lecture android best practices
Lecture   android best practicesLecture   android best practices
Lecture android best practices
 
intoduction to Grails Framework
intoduction to Grails Frameworkintoduction to Grails Framework
intoduction to Grails Framework
 
Selecting the Best Javascript Web Framework
Selecting the Best Javascript Web FrameworkSelecting the Best Javascript Web Framework
Selecting the Best Javascript Web Framework
 
GR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting GrailsGR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting Grails
 
Adopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf EuropeAdopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf Europe
 
Node.js Development Tools
 Node.js Development Tools Node.js Development Tools
Node.js Development Tools
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the Cloud
 
9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose
 
The Javascript Toolkit 2.0
The Javascript Toolkit 2.0The Javascript Toolkit 2.0
The Javascript Toolkit 2.0
 
Java script Session No 1
Java script Session No 1Java script Session No 1
Java script Session No 1
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Spring Roo Flex Add-on
Spring Roo Flex Add-onSpring Roo Flex Add-on
Spring Roo Flex Add-on
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on Rails
 
From React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I startedFrom React to React Native - Things I wish I knew when I started
From React to React Native - Things I wish I knew when I started
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
 
A Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using DockerA Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using Docker
 
Js frameworks
Js frameworksJs frameworks
Js frameworks
 

Más de David Parsons

Más de David Parsons (15)

Applying Theories in Mobile Learning Research
Applying Theories in Mobile Learning ResearchApplying Theories in Mobile Learning Research
Applying Theories in Mobile Learning Research
 
Exploring Mobile Affordances in the Digital Classroom
Exploring Mobile Affordances in the Digital ClassroomExploring Mobile Affordances in the Digital Classroom
Exploring Mobile Affordances in the Digital Classroom
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
A Brief Guide to Game Engines
A Brief Guide to Game EnginesA Brief Guide to Game Engines
A Brief Guide to Game Engines
 
Planning Poker
Planning PokerPlanning Poker
Planning Poker
 
Creating game like activities in agile software engineering education
Creating game like activities in agile software engineering educationCreating game like activities in agile software engineering education
Creating game like activities in agile software engineering education
 
Localizing mobile learning policy for maximum return on investment and stakeh...
Localizing mobile learning policy for maximum return on investment and stakeh...Localizing mobile learning policy for maximum return on investment and stakeh...
Localizing mobile learning policy for maximum return on investment and stakeh...
 
Cloud Analytics - Using cloud based services to analyse big data
Cloud Analytics - Using cloud based services to analyse big dataCloud Analytics - Using cloud based services to analyse big data
Cloud Analytics - Using cloud based services to analyse big data
 
M learning Devices in Education
M learning Devices in EducationM learning Devices in Education
M learning Devices in Education
 
Jam today - Embedding BYOD into Classroom Practice
Jam today - Embedding BYOD into Classroom PracticeJam today - Embedding BYOD into Classroom Practice
Jam today - Embedding BYOD into Classroom Practice
 
The Java Story
The Java StoryThe Java Story
The Java Story
 
An Introduction to MusicXML
An Introduction to MusicXMLAn Introduction to MusicXML
An Introduction to MusicXML
 
Designing mobile games for engagement and learning
Designing mobile games for engagement and learningDesigning mobile games for engagement and learning
Designing mobile games for engagement and learning
 
The Impact of Methods and Techniques on Outcomes from Agile Software Developm...
The Impact of Methods and Techniques on Outcomes from Agile Software Developm...The Impact of Methods and Techniques on Outcomes from Agile Software Developm...
The Impact of Methods and Techniques on Outcomes from Agile Software Developm...
 
Interaction on the Move
Interaction on the MoveInteraction on the Move
Interaction on the Move
 

Último

Último (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Naked Objects and Groovy Grails

  • 1. Domain driven web applications made simple IIMS Seminar March 21st 2012 Associate Professor David Parsons
  • 2. The „Naked Objects‟ pattern was originally described by Richard Pawson in his PhD thesis ◦ Based on earlier work on „Expressive Systems‟  3 principles: 1. Business logic should be encapsulated in domain objects 2. The user interface should be a direct representation of the domain objects 3. The user interface should be automatically generated from the definition of the domain objects 2
  • 3. A faster development cycle ◦ There are fewer layers of code to develop  Greater agility ◦ Easier to accommodate future changes in business requirements  A more empowering style of user interface ◦ Direct interaction with the domain  Easier requirements analysis ◦ Common domain understanding 3
  • 4. “an expressive system has a „make it so‟ button” ◦ - Richard Pawson 4
  • 5. As 1960s high level languages?  As 1970s rapid application development?  As 1980s 4GLs?  As 1990s visual programming?  As 2000s web frameworks? 5
  • 6. 6
  • 7. Isn‟t what it used to be… 7
  • 8. A whole bunch of web apps are basically just create/read/update/delete (CRUD) ◦ Facebook ◦ Twitter ◦ On-line banking ◦ Google Docs ◦ YouTube ◦ Flickr ◦ …  I could go on, you get the point… 8
  • 9. A simple CRUD application involves four views for each domain concept ◦ Creating ◦ Editing (update/delete) ◦ Listing many items (read) ◦ Showing single item details (read)  n entities = 4*n pages  These views are all very much the same apart from the fields being exposed  Useful if a framework can build these views automatically 9
  • 10. Over the last decade or so, the naked objects pattern has appeared in a number of tools  Grails (a Groovy web framework) is one of these…. 10
  • 11. A dynamic language, compiled to Java bytecode, to run on a Java virtual machine  Uses a Java-like syntax  Interoperates with other Java code and libraries  Most Java code is also syntactically valid Groovy  Groovy implicitly generates data access operations on domain objects 11
  • 12. Grails (formerly Groovy on Rails) is an open source web framework built on Spring using the Groovy language ◦ Spring is a Java web framework that uses other frameworks  Grails takes its architectural style from Ruby on Rails  You can also find this style in other tools such as Scala Lift 12
  • 13. Grails includes everything you need  Integrates several common libraries and frameworks  Developers can focus on business logic rather than integration  You don‟t have to manually glue all the different components together 13
  • 14. Grails is based on Spring in order to reuse some core services  Spring uses dependency Injection, a specific type of Inversion of Control  The framework can inject capabilities into objects that follow certain rules of coding  Think of it as being like different lightbulbs that have the same fitting 14
  • 15. Execution of repetitive tasks by the framework  Use of scaffolding  The framework generates artifacts related to repetitive tasks ◦ views and controllers  Repetitive tasks are gone  Developer customizes the artifacts 15
  • 16. You don‟t need configuration files if everything is in place  Grails stipulates conventions that make configuration files unnecessary ◦ e.g. every controller is stored in a specific directory  Probably the only configuration file you‟ll need will be the one which is for database access 16
  • 17. The Boating Lake Management System ◦ Captain Bob runs a business hiring out rowing boats on boating lakes ◦ He wants a system to help him manage his thriving business ◦ Two of the key concepts in the system are Rowing Boat and Lake ◦ There is a one to many relationship between them (one lake can have many rowing boats)  Demo uses the SpringSource Toolsuite for Grails development 17
  • 18. This is a domain class  We add a few properties and a relationship (to one other object) 18
  • 19. This is also a domain class  Again we add a few properties and a relationship (to many other objects) 19
  • 20. e.g. for the Rowing Boat  To make the controller and views dynamic, use a scaffold in the controllers 20
  • 21. Web app to go ◦ („prod run-app‟ would also persist the data in the database) 21
  • 22. Easy to add validation, field ordering and visibility, formatting, style sheets etc.  Most tasks driven from within the domain objects  For further info see http://grails.org/ 22