SlideShare uma empresa Scribd logo
1 de 33
THE POWER OF PERSPECTIVE




                                                      Grails Workshop
                                                  Dallas TechFest 2011
                                                                            August 13, 2011


                                                                             Erik Weibust
                                                                            @erikweibust
                           Copyright © 2011 Credera. All Rights Reserved.
www.credera.com



        Who am I? Erik Weibust…

         Husband / Father
         Fightin’ Texas Aggie
         Sports Fan
         Blogger
         Twiter-er… tweeter?
         Fan of Java and the JVM (Evangelist)
              – President of JavaMUG
              – Founder of the Spring Dallas Users Group (SDUG)
              – Co-Founder of the DFW Groovy – Grails Users Group (DFW2GUG)
         Senior Architect at Credera
              – 14 years experience as an IT Professional
              – 12 years experience with Java
              – Last 4 years at Credera


Copyright © 2011 Credera.
                                                             -2-
   All Rights Reserved.
                                  T H E   P O W E R         O F    P E R S P E C T I V E
www.credera.com



        About Erik Weibust: Husband, Father, and Fightin’ Texas Aggie




Copyright © 2011 Credera.
                                                 -3-
   All Rights Reserved.
                            T H E   P O W E R   O F    P E R S P E C T I V E
www.credera.com



        About Erik Weibust: Sports Fan

         Text Hee




Copyright © 2011 Credera.
                                                 -4-
   All Rights Reserved.
                            T H E   P O W E R   O F    P E R S P E C T I V E
www.credera.com



        About Erik Weibust: Blogger / Twitter-er




Copyright © 2011 Credera.
                                                   -5-
   All Rights Reserved.
                            T H E   P O W E R   O F      P E R S P E C T I V E
www.credera.com



        About Erik Weibust: Spring Dallas UG, DFW 2GUG, JavaMUG President

         Text Here




Copyright © 2011 Credera.
                                                 -6-
   All Rights Reserved.
                            T H E   P O W E R   O F    P E R S P E C T I V E
www.credera.com



        About Erik Weibust: Senior Architect at Credera




Copyright © 2011 Credera.
                                                 -7-
   All Rights Reserved.
                            T H E   P O W E R   O F    P E R S P E C T I V E
www.credera.com



        Agenda

         What is Grails and why would I use it
         Installing and Developing with Grails
         Wait a minute, what is Groovy
         What are we Building?
         Creating our Grails Application – Step 1
                                                              We’ve Got a Lot to Do… Let’s Get Started!
         Creating our Domain Model – Step 2
         We need Data – Step 3
         Lets tweak these boring Views – Step 4
         Are you too good for your Home – Step 5
         Custom URL Mappings – Step 6




Copyright © 2011 Credera.
                                                      -8-
   All Rights Reserved.
                               T H E    P O W E R    O F    P E R S P E C T I V E
www.credera.com



        What is Grails and why would I use it

         Rapid Application Development Framework
         Tightly bound to Java Ecosystem (can be both positive and negative)
         Built on top of frameworks you know and use: Spring, Spring MVC, Hibernate, and Tomcat
         Convention over Configuration
         Makes web development simpler with Groovy




Copyright © 2011 Credera.
                                                       -9-
   All Rights Reserved.
                              T H E    P O W E R     O F     P E R S P E C T I V E
www.credera.com



        Installing and Developing with Grails

         Install Java5 SE SDK and set JAVA_HOME environment variable
         Download latest Grails release (http://grails.org/Download)
         Extract Grails archive into appropriate location (I use C:devsdks)
         Create GRAILS_HOME env variable that points to location in previous step
         Append %GRAILS_HOME%bin to your PATH variable




Copyright © 2011 Credera.
                                                         - 10 -
   All Rights Reserved.
                               T H E     P O W E R     O F        P E R S P E C T I V E
www.credera.com



        Wait a minute, what is Groovy

         Programming lang on JVM
         Highly compatible with Java
              – Seriously, rename .java file with .groovy and you’re done
              – Optional semicolons
              – Sometimes optional parentheses (I always use, makes code more readable)
              – “Look Ma, no returns”
         Properties and it’s “cousin feature” named-argument constructors
         Simple debugging when learning: println and thingy.class.name
         Lists, Maps, and Closures




Copyright © 2011 Credera.
                                                           - 11 -
   All Rights Reserved.
                                 T H E    P O W E R      O F        P E R S P E C T I V E
www.credera.com



        Domain Class in Java: Person.java




Copyright © 2011 Credera.
                                                 - 12 -
   All Rights Reserved.
                            T H E   P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Same Domain Class in Groovy: Person.groovy




         Look at this Person
         class … Just 3 lines
         of code! Previous
         slide shows same
         class in Java took
         26 lines!




Copyright © 2011 Credera.
                                                     - 13 -
   All Rights Reserved.
                                T H E   P O W E R   O F       P E R S P E C T I V E
www.credera.com



        The Kitchen Sink of Groovy “stuff”




Copyright © 2011 Credera.
                                                 - 14 -
   All Rights Reserved.
                            T H E   P O W E R   O F       P E R S P E C T I V E
www.credera.com



        What are we Building? A Web-based Conference Management Tool

         Grails-based version of TechFest
          website
              – Runs on open-source
                technology
              – Fixes the many to many
                Speaker – Session
                relationship




Copyright © 2011 Credera.
                                                      - 15 -
   All Rights Reserved.
                                T H E    P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Dallas TechFest Domain Model




Copyright © 2011 Credera.
                                                 - 16 -
   All Rights Reserved.
                            T H E   P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Creating our Grails Application – Step 1

         Create with the following
          command:
         $ grails create-app techfest
         We have a working, runnable
          application…
         Lets take a look, run the
          following commands:
         $ cd techfest
         $grails run-app




Copyright © 2011 Credera.
                                                      - 17 -
   All Rights Reserved.
                               T H E     P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Creating our Grails Application – Step 1 cont.

         Here you can see the standard
          Grails project structure
              – Our application code is
                primarily inside of grails-
                app/
              – Have a lib/ for application
                specific jar files (JDBC driver)
              – Testing is baked into Grails,
                we have unit and integration
                tests in test/
              – All standard CSS, JavaScript
                and images are in web-app/




Copyright © 2011 Credera.
                                                           - 18 -
   All Rights Reserved.
                                   T H E      P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Creating our Domain Model – Step 2

         Create our domain classes with the
          following commands:
              – $ grails create-domain-class Speaker
              – $ grails create-domain-class Session
              – $ grails create-domain-class Sponsor

                                                        Now implement our Speaker




Copyright © 2011 Credera.
                                                        - 19 -
   All Rights Reserved.
                                 T H E     P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Creating our Domain Model – Step 2 cont.

         We also need to create our controllers so
          we can interact with our domain classes
         Run the following commands:
              – $ grails create-controller Speaker
              – $ grails create-controller Session
              – $ grails create-controller Sponsor      Now lets take a look at our Speaker!

         Now edit each controller, replacing our
          index {} closure property with the
                                                         Finished version of our Speaker Controller,
          following scaffolding statement:
                                                         the other controllers should look the same
              – def scaffold = true




Copyright © 2011 Credera.
                                                          - 20 -
   All Rights Reserved.
                                  T H E     P O W E R   O F        P E R S P E C T I V E
www.credera.com



        Creating our Domain Model – Step 2 cont.

         Now we can finish our Speaker, adding the
          logical constraints


         Highlights on Constraints:                  Fully implemented Speaker w/ constraints

              – Validation on Creation
              – Declarative syntax
              – DSL




Copyright © 2011 Credera.
                                                         - 21 -
   All Rights Reserved.
                                 T H E   P O W E R     O F        P E R S P E C T I V E
www.credera.com



        Creating our Domain Model – Step 2 cont.

         Lets complete our Session and Sponsor
          Domain Model classes
                                                                                       Our Sponsor Class




              And our Session Class




Copyright © 2011 Credera.
                                                      - 22 -
   All Rights Reserved.
                                 T H E   P O W E R   O F       P E R S P E C T I V E
www.credera.com



        We need Data – Step 3

         OUCH! That was painful
          entering our “test” data
          each time we restarted our
          server…. BootStrap.groovy
          to the rescue.


         Back to Scaffolding:
              – Lets convert from
                dynamic views and
                controllers to concrete
                implementations
         $ grails generate-all “*”
              – Enter “Y” for yes, to
                overwrite our original
                files
         Lets take a look…


Copyright © 2011 Credera.
                                                       - 23 -
   All Rights Reserved.
                                 T H E    P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Lets tweak these boring Views – Step 4

         Lets “clean up” our
          Speaker page:
              – Open grails-
                app/views/speaker/sh
                ow.gsp
              – Replace Show Speaker
                text with Speaker’s
                name
              – Remove the database
                id field from our view
              – Make the Speaker’s
                name link back to the
                Speaker record (make
                sure and ask me why)




Copyright © 2011 Credera.
                                                       - 24 -
   All Rights Reserved.
                                  T H E   P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Lets tweak these boring Views – Step 4 cont.

         Start by replacing the <h1>
          with our new <h1> that
          utilizes the ${fieldValue(
          bean:speakerInstance,
          field:”firstName” ) } syntax
         Delete or comment-out
          the first three <tr>s to
          remove: id, firstName, and
          lastName
         Add g:link to create a link
          back to our record
         See Grails documentation
          for more info on <g:link>
          http://www.grails.org/doc/
          latest/ref/Tags/link.html




Copyright © 2011 Credera.
                                                      - 25 -
   All Rights Reserved.
                                T H E    P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Are you too good for your Home – Step 5

         First step is swapping out
          the Grails logo for the
          TechFest logo
              – Copy image file to web-
                app/images
              – Update grails-
                app/views/layouts/main
                .gsp




Copyright © 2011 Credera.
                                                       - 26 -
   All Rights Reserved.
                                 T H E    P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Are you too good for your Home – Step 5 cont.

         Second step in refactoring
          our “home” page is
          updating grails-
          app/views/index.gsp
              – Make the following 2
                CSS changes to move
                our nav bar to the right
              – Then add the “nav”
                <div> right after the
                <body> tag to get our
                navigation bar added to
                our “home” page
         Last step is two pull in the
          two sponsor logos and the
          “copy” from our thumb
          drives




Copyright © 2011 Credera.
                                                        - 27 -
   All Rights Reserved.
                                  T H E    P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Custom URL Mappings – Step 6

         Last “tweak” we will
          make to our techfest
          application is writing
          some custom URL
          mappings to match the
          URL patterns used on                           grails-app/conf/UrlMappings.groovy
          the
          http://dallastechfest.co
          m site
         Make the following
          additions to our
          UrlMappings.groovy file




Copyright © 2011 Credera.
                                                    - 28 -
   All Rights Reserved.
                               T H E   P O W E R   O F       P E R S P E C T I V E
www.credera.com



        Finished: We have our TechFest website…




Copyright © 2011 Credera.
                                                  - 29 -
   All Rights Reserved.
                            T H E   P O W E R   O F        P E R S P E C T I V E
www.credera.com



        Where to go for more information

         Grails Website
              – Phenomenal Documentation
              – Screencasts
              – Tutorials
         Books
              – Grails: A Quick-Start Guide by Dave Klein (http://pragprog.com/book/dkgrails/grails)
              – The Definitive Guide to Grails by Graeme Rocher, Jeff Brown
                (http://www.apress.com/9781590599952)
         Magazine
              – GROOVYMAG (http://groovymag.com/)
         DFW Groovy – Grails Users Group (http://www.dfw2gug.org or @dfw2gug)




Copyright © 2011 Credera.
                                                           - 30 -
   All Rights Reserved.
                                  T H E    P O W E R     O F        P E R S P E C T I V E
www.credera.com


       Credera is a Business and Technology Consulting Firm that Focuses on Leveraging Proven
       Technologies to Enable our Clients Business Strategy
        Our Company                                               Our People
             – Full-service business and technology                     – Credera’s professionals possess a unique
               consulting firm                                            combination of deep technical expertise with
                                                                          extensive business backgrounds
             – Provide business and technology solutions
               that offer measurable value to our clients               – Backgrounds include business, technology, and
                                                                          strategy management consulting with some of the
             – Deliver value by leveraging our people’s                   most well-known and respected consulting firms
               accumulated industry and management                        in the world
               experience with their deep technical
               expertise                                                – Have served many influential corporations in a
                                                                          variety of industries over the past 20 years
             – Established in 1999

             – Offices in Dallas, Austin, Denver
                                                                   Sample Clients

        Our Services
             – Management Consulting

             – Technology Solutions

             – Business Intelligence


Copyright © 2011 Credera.
                                                             - 31 -
   All Rights Reserved.
                                     T H E     P O W E R    O F       P E R S P E C T I V E
www.credera.com



        Q&A

                            Thank you for attending!

                                 Contact Information:
                                      Erik Weibust
                                   erik@weibust.net
                                http://erik.weibust.net
                                Twitter: @erikweibust



Copyright © 2011 Credera.
                                                 - 32 -
   All Rights Reserved.
                            T H E   P O W E R   O F       P E R S P E C T I V E
THE POWER OF PERSPECTIVE




                                                      Grails Workshop
                                                  Dallas TechFest 2011
                                                                            August 13, 2011


                                                                             Erik Weibust
                                                                            @erikweibust
                           Copyright © 2011 Credera. All Rights Reserved.

Mais conteúdo relacionado

Semelhante a Grails Workshop - Dallas TechFest 2011

Using jQuery and WCF To Build a Better User Experience
Using jQuery and WCF To Build a Better User ExperienceUsing jQuery and WCF To Build a Better User Experience
Using jQuery and WCF To Build a Better User Experiencejthewitt
 
JQuery and WCF for a Better User Experience
JQuery and WCF for a Better User ExperienceJQuery and WCF for a Better User Experience
JQuery and WCF for a Better User ExperienceCredera
 
Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15
Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15
Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15MLconf
 
An Introduction to Spring Data
An Introduction to Spring DataAn Introduction to Spring Data
An Introduction to Spring DataOliver Gierke
 
Aspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalAspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalCredera
 
CON 3431 - Introducing Java Programming to Kids
CON 3431 - Introducing Java Programming to KidsCON 3431 - Introducing Java Programming to Kids
CON 3431 - Introducing Java Programming to KidsArun Gupta
 
An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14
An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14
An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14iwrigley
 
Coding for desktop and mobile with HTML5 and Java EE 7 - Geertjan Wielenga
Coding for desktop and mobile with HTML5 and Java EE 7 - Geertjan WielengaCoding for desktop and mobile with HTML5 and Java EE 7 - Geertjan Wielenga
Coding for desktop and mobile with HTML5 and Java EE 7 - Geertjan WielengaJAXLondon_Conference
 
10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScriptGeertjan Wielenga
 
ReSearch - Searching for Researchers
ReSearch - Searching for ResearchersReSearch - Searching for Researchers
ReSearch - Searching for ResearchersDavide Eynard
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011François Scharffe
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' C2B2 Consulting
 
Jenzabar at GlassFish Community Event, JavaOne 2011
Jenzabar at GlassFish Community Event, JavaOne 2011Jenzabar at GlassFish Community Event, JavaOne 2011
Jenzabar at GlassFish Community Event, JavaOne 2011Arun Gupta
 
GlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 ConsultingGlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 Consultingglassfish
 
Database Developers: the most important developers on earth?
Database Developers: the most important developers on earth?Database Developers: the most important developers on earth?
Database Developers: the most important developers on earth?Steven Feuerstein
 

Semelhante a Grails Workshop - Dallas TechFest 2011 (20)

Using jQuery and WCF To Build a Better User Experience
Using jQuery and WCF To Build a Better User ExperienceUsing jQuery and WCF To Build a Better User Experience
Using jQuery and WCF To Build a Better User Experience
 
JQuery and WCF for a Better User Experience
JQuery and WCF for a Better User ExperienceJQuery and WCF for a Better User Experience
JQuery and WCF for a Better User Experience
 
Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15
Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15
Josh Wills, Director of Data Science, Cloudera at MLconf SEA - 5/01/15
 
An Introduction to Spring Data
An Introduction to Spring DataAn Introduction to Spring Data
An Introduction to Spring Data
 
Aspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalAspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_final
 
CON 3431 - Introducing Java Programming to Kids
CON 3431 - Introducing Java Programming to KidsCON 3431 - Introducing Java Programming to Kids
CON 3431 - Introducing Java Programming to Kids
 
An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14
An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14
An Introduction to Hadoop and Cloudera: Nashville Cloudera User Group, 10/23/14
 
Session at Oredev 2016.
Session at Oredev 2016.Session at Oredev 2016.
Session at Oredev 2016.
 
Java Master Class
Java Master ClassJava Master Class
Java Master Class
 
Slovenian Oracle User Group
Slovenian Oracle User GroupSlovenian Oracle User Group
Slovenian Oracle User Group
 
Coding for desktop and mobile with HTML5 and Java EE 7 - Geertjan Wielenga
Coding for desktop and mobile with HTML5 and Java EE 7 - Geertjan WielengaCoding for desktop and mobile with HTML5 and Java EE 7 - Geertjan Wielenga
Coding for desktop and mobile with HTML5 and Java EE 7 - Geertjan Wielenga
 
10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript10 Building Blocks for Enterprise JavaScript
10 Building Blocks for Enterprise JavaScript
 
ReSearch - Searching for Researchers
ReSearch - Searching for ResearchersReSearch - Searching for Researchers
ReSearch - Searching for Researchers
 
Imworld.ro
Imworld.roImworld.ro
Imworld.ro
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
 
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
Datalift a-catalyser-for-the-web-of-data-fosdem-05-02-2011
 
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit' 'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
'JMS @ Data Grid? Hacking the Glassfish messaging for fun & profit'
 
Jenzabar at GlassFish Community Event, JavaOne 2011
Jenzabar at GlassFish Community Event, JavaOne 2011Jenzabar at GlassFish Community Event, JavaOne 2011
Jenzabar at GlassFish Community Event, JavaOne 2011
 
GlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 ConsultingGlassFish Story by Jaromir Hamala/C2B2 Consulting
GlassFish Story by Jaromir Hamala/C2B2 Consulting
 
Database Developers: the most important developers on earth?
Database Developers: the most important developers on earth?Database Developers: the most important developers on earth?
Database Developers: the most important developers on earth?
 

Último

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 educationjfdjdjcjdnsjd
 
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
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony 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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 

Último (20)

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
 
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
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony 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 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Grails Workshop - Dallas TechFest 2011

  • 1. THE POWER OF PERSPECTIVE Grails Workshop Dallas TechFest 2011 August 13, 2011 Erik Weibust @erikweibust Copyright © 2011 Credera. All Rights Reserved.
  • 2. www.credera.com Who am I? Erik Weibust…  Husband / Father  Fightin’ Texas Aggie  Sports Fan  Blogger  Twiter-er… tweeter?  Fan of Java and the JVM (Evangelist) – President of JavaMUG – Founder of the Spring Dallas Users Group (SDUG) – Co-Founder of the DFW Groovy – Grails Users Group (DFW2GUG)  Senior Architect at Credera – 14 years experience as an IT Professional – 12 years experience with Java – Last 4 years at Credera Copyright © 2011 Credera. -2- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 3. www.credera.com About Erik Weibust: Husband, Father, and Fightin’ Texas Aggie Copyright © 2011 Credera. -3- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 4. www.credera.com About Erik Weibust: Sports Fan  Text Hee Copyright © 2011 Credera. -4- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 5. www.credera.com About Erik Weibust: Blogger / Twitter-er Copyright © 2011 Credera. -5- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 6. www.credera.com About Erik Weibust: Spring Dallas UG, DFW 2GUG, JavaMUG President  Text Here Copyright © 2011 Credera. -6- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 7. www.credera.com About Erik Weibust: Senior Architect at Credera Copyright © 2011 Credera. -7- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 8. www.credera.com Agenda  What is Grails and why would I use it  Installing and Developing with Grails  Wait a minute, what is Groovy  What are we Building?  Creating our Grails Application – Step 1 We’ve Got a Lot to Do… Let’s Get Started!  Creating our Domain Model – Step 2  We need Data – Step 3  Lets tweak these boring Views – Step 4  Are you too good for your Home – Step 5  Custom URL Mappings – Step 6 Copyright © 2011 Credera. -8- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 9. www.credera.com What is Grails and why would I use it  Rapid Application Development Framework  Tightly bound to Java Ecosystem (can be both positive and negative)  Built on top of frameworks you know and use: Spring, Spring MVC, Hibernate, and Tomcat  Convention over Configuration  Makes web development simpler with Groovy Copyright © 2011 Credera. -9- All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 10. www.credera.com Installing and Developing with Grails  Install Java5 SE SDK and set JAVA_HOME environment variable  Download latest Grails release (http://grails.org/Download)  Extract Grails archive into appropriate location (I use C:devsdks)  Create GRAILS_HOME env variable that points to location in previous step  Append %GRAILS_HOME%bin to your PATH variable Copyright © 2011 Credera. - 10 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 11. www.credera.com Wait a minute, what is Groovy  Programming lang on JVM  Highly compatible with Java – Seriously, rename .java file with .groovy and you’re done – Optional semicolons – Sometimes optional parentheses (I always use, makes code more readable) – “Look Ma, no returns”  Properties and it’s “cousin feature” named-argument constructors  Simple debugging when learning: println and thingy.class.name  Lists, Maps, and Closures Copyright © 2011 Credera. - 11 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 12. www.credera.com Domain Class in Java: Person.java Copyright © 2011 Credera. - 12 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 13. www.credera.com Same Domain Class in Groovy: Person.groovy Look at this Person class … Just 3 lines of code! Previous slide shows same class in Java took 26 lines! Copyright © 2011 Credera. - 13 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 14. www.credera.com The Kitchen Sink of Groovy “stuff” Copyright © 2011 Credera. - 14 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 15. www.credera.com What are we Building? A Web-based Conference Management Tool  Grails-based version of TechFest website – Runs on open-source technology – Fixes the many to many Speaker – Session relationship Copyright © 2011 Credera. - 15 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 16. www.credera.com Dallas TechFest Domain Model Copyright © 2011 Credera. - 16 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 17. www.credera.com Creating our Grails Application – Step 1  Create with the following command:  $ grails create-app techfest  We have a working, runnable application…  Lets take a look, run the following commands:  $ cd techfest  $grails run-app Copyright © 2011 Credera. - 17 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 18. www.credera.com Creating our Grails Application – Step 1 cont.  Here you can see the standard Grails project structure – Our application code is primarily inside of grails- app/ – Have a lib/ for application specific jar files (JDBC driver) – Testing is baked into Grails, we have unit and integration tests in test/ – All standard CSS, JavaScript and images are in web-app/ Copyright © 2011 Credera. - 18 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 19. www.credera.com Creating our Domain Model – Step 2  Create our domain classes with the following commands: – $ grails create-domain-class Speaker – $ grails create-domain-class Session – $ grails create-domain-class Sponsor Now implement our Speaker Copyright © 2011 Credera. - 19 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 20. www.credera.com Creating our Domain Model – Step 2 cont.  We also need to create our controllers so we can interact with our domain classes  Run the following commands: – $ grails create-controller Speaker – $ grails create-controller Session – $ grails create-controller Sponsor Now lets take a look at our Speaker!  Now edit each controller, replacing our index {} closure property with the Finished version of our Speaker Controller, following scaffolding statement: the other controllers should look the same – def scaffold = true Copyright © 2011 Credera. - 20 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 21. www.credera.com Creating our Domain Model – Step 2 cont.  Now we can finish our Speaker, adding the logical constraints  Highlights on Constraints: Fully implemented Speaker w/ constraints – Validation on Creation – Declarative syntax – DSL Copyright © 2011 Credera. - 21 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 22. www.credera.com Creating our Domain Model – Step 2 cont.  Lets complete our Session and Sponsor Domain Model classes Our Sponsor Class And our Session Class Copyright © 2011 Credera. - 22 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 23. www.credera.com We need Data – Step 3  OUCH! That was painful entering our “test” data each time we restarted our server…. BootStrap.groovy to the rescue.  Back to Scaffolding: – Lets convert from dynamic views and controllers to concrete implementations  $ grails generate-all “*” – Enter “Y” for yes, to overwrite our original files  Lets take a look… Copyright © 2011 Credera. - 23 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 24. www.credera.com Lets tweak these boring Views – Step 4  Lets “clean up” our Speaker page: – Open grails- app/views/speaker/sh ow.gsp – Replace Show Speaker text with Speaker’s name – Remove the database id field from our view – Make the Speaker’s name link back to the Speaker record (make sure and ask me why) Copyright © 2011 Credera. - 24 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 25. www.credera.com Lets tweak these boring Views – Step 4 cont.  Start by replacing the <h1> with our new <h1> that utilizes the ${fieldValue( bean:speakerInstance, field:”firstName” ) } syntax  Delete or comment-out the first three <tr>s to remove: id, firstName, and lastName  Add g:link to create a link back to our record  See Grails documentation for more info on <g:link> http://www.grails.org/doc/ latest/ref/Tags/link.html Copyright © 2011 Credera. - 25 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 26. www.credera.com Are you too good for your Home – Step 5  First step is swapping out the Grails logo for the TechFest logo – Copy image file to web- app/images – Update grails- app/views/layouts/main .gsp Copyright © 2011 Credera. - 26 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 27. www.credera.com Are you too good for your Home – Step 5 cont.  Second step in refactoring our “home” page is updating grails- app/views/index.gsp – Make the following 2 CSS changes to move our nav bar to the right – Then add the “nav” <div> right after the <body> tag to get our navigation bar added to our “home” page  Last step is two pull in the two sponsor logos and the “copy” from our thumb drives Copyright © 2011 Credera. - 27 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 28. www.credera.com Custom URL Mappings – Step 6  Last “tweak” we will make to our techfest application is writing some custom URL mappings to match the URL patterns used on grails-app/conf/UrlMappings.groovy the http://dallastechfest.co m site  Make the following additions to our UrlMappings.groovy file Copyright © 2011 Credera. - 28 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 29. www.credera.com Finished: We have our TechFest website… Copyright © 2011 Credera. - 29 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 30. www.credera.com Where to go for more information  Grails Website – Phenomenal Documentation – Screencasts – Tutorials  Books – Grails: A Quick-Start Guide by Dave Klein (http://pragprog.com/book/dkgrails/grails) – The Definitive Guide to Grails by Graeme Rocher, Jeff Brown (http://www.apress.com/9781590599952)  Magazine – GROOVYMAG (http://groovymag.com/)  DFW Groovy – Grails Users Group (http://www.dfw2gug.org or @dfw2gug) Copyright © 2011 Credera. - 30 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 31. www.credera.com Credera is a Business and Technology Consulting Firm that Focuses on Leveraging Proven Technologies to Enable our Clients Business Strategy  Our Company  Our People – Full-service business and technology – Credera’s professionals possess a unique consulting firm combination of deep technical expertise with extensive business backgrounds – Provide business and technology solutions that offer measurable value to our clients – Backgrounds include business, technology, and strategy management consulting with some of the – Deliver value by leveraging our people’s most well-known and respected consulting firms accumulated industry and management in the world experience with their deep technical expertise – Have served many influential corporations in a variety of industries over the past 20 years – Established in 1999 – Offices in Dallas, Austin, Denver  Sample Clients  Our Services – Management Consulting – Technology Solutions – Business Intelligence Copyright © 2011 Credera. - 31 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 32. www.credera.com Q&A Thank you for attending! Contact Information: Erik Weibust erik@weibust.net http://erik.weibust.net Twitter: @erikweibust Copyright © 2011 Credera. - 32 - All Rights Reserved. T H E P O W E R O F P E R S P E C T I V E
  • 33. THE POWER OF PERSPECTIVE Grails Workshop Dallas TechFest 2011 August 13, 2011 Erik Weibust @erikweibust Copyright © 2011 Credera. All Rights Reserved.