SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a Naked Objects and Groovy Grails

Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)Cloud development technology sharing (BlueMix premier)
Cloud development technology sharing (BlueMix premier)湯米吳 Tommy Wu
 
A Tour of Ruby On Rails
A Tour of Ruby On RailsA Tour of Ruby On Rails
A Tour of Ruby On RailsDavid Keener
 
Lecture android best practices
Lecture   android best practicesLecture   android best practices
Lecture android best practiceseleksdev
 
intoduction to Grails Framework
intoduction to Grails Frameworkintoduction to Grails Framework
intoduction to Grails FrameworkHarshdeep Kaur
 
Selecting the Best Javascript Web Framework
Selecting the Best Javascript Web FrameworkSelecting the Best Javascript Web Framework
Selecting the Best Javascript Web FrameworkRajitha Pathiraja
 
GR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting GrailsGR8Conf 2011: Adopting Grails
GR8Conf 2011: Adopting GrailsGR8Conf
 
Adopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf EuropeAdopting Grails - GR8Conf Europe
Adopting Grails - GR8Conf EuropeKlausBaumecker
 
Node.js Development Tools
 Node.js Development Tools Node.js Development Tools
Node.js Development ToolsSofiaCarter4
 
Custom Runtimes for the Cloud
Custom Runtimes for the CloudCustom Runtimes for the Cloud
Custom Runtimes for the CloudCloudBees
 
9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To Choose9 Best JavaScript Frameworks To Choose
9 Best JavaScript Frameworks To ChooseAlbiorix Technology
 
The Javascript Toolkit 2.0
The Javascript Toolkit 2.0The Javascript Toolkit 2.0
The Javascript Toolkit 2.0Marcos Vinícius
 
Java script Session No 1
Java script Session No 1Java script Session No 1
Java script Session No 1Saif Ullah Dar
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with DockerAndrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with DockerAndrey Hristov
 
Spring Roo Flex Add-on
Spring Roo Flex Add-onSpring Roo Flex Add-on
Spring Roo Flex Add-onBill Ott
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on RailsViridians
 
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 startedsparkfabrik
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersRyan Hodgin
 
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 DockerAjeet Singh Raina
 

Semelhante 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
 

Mais de David Parsons

Applying Theories in Mobile Learning Research
Applying Theories in Mobile Learning ResearchApplying Theories in Mobile Learning Research
Applying Theories in Mobile Learning ResearchDavid Parsons
 
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 ClassroomDavid Parsons
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSDavid Parsons
 
A Brief Guide to Game Engines
A Brief Guide to Game EnginesA Brief Guide to Game Engines
A Brief Guide to Game EnginesDavid Parsons
 
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 educationDavid Parsons
 
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...David Parsons
 
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 dataDavid Parsons
 
M learning Devices in Education
M learning Devices in EducationM learning Devices in Education
M learning Devices in EducationDavid Parsons
 
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 PracticeDavid Parsons
 
An Introduction to MusicXML
An Introduction to MusicXMLAn Introduction to MusicXML
An Introduction to MusicXMLDavid Parsons
 
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 learningDavid Parsons
 
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...David Parsons
 
Interaction on the Move
Interaction on the MoveInteraction on the Move
Interaction on the MoveDavid Parsons
 

Mais 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

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 

Último (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.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