Your SlideShare is downloading. ×
Powerpoint
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Powerpoint

580

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
580
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • This is part of the page model for an application in Rational System modeller. In the top left hand corner, we have a navigation pane showing the files and directories in the project. Bottom left: this shows the overall model, and the piece we're seeing. In the centre, we have part of the page model. The boxes are pages; the lines are event (buttons or links) that navigate between the pages. At the bottom is a log area showing the action from a build.
  • This shows the entity model. The boxes are entities - well mostly - and the lines between them are entity relations. We also have - a box for the application component and - a "data view" - an object that gives us a "view" of the entity data (like a SQL view gives us a view of database tables)
  • "Model-to-model transformation" PIM to PSM ... but not really - we might hop over levels in the meta-model; we might even go up the meta-model levels! Notice - we're reusing Velocity - we have no need of QVT. If you can write some script, you can write a pattern. _____________________________________ Types of patterns: - fix-up pattern - coordination - back to building components level and cross-tier proxies - implementation patterns - e.g. the - cross-tier patterns - generate default logical data (data-views) from physical data (entities), and gradually build the CRUD screens.
  • This shows the generated architecture. We have some technical people ask us to support different frameworks, but business users don't care. It's the speed of creating and changing systems that is important. Business users may well care about additional functionality - e.g. JSF/AJAX to get a richer/faster user experience.
  • These two pages show part of an application generated with JeeWiz. These pages take too long to build in a live demonstration, but the point is this is a reasonably complex page, linking to lots of other pages (we showed the model for this page earlier).
  • Transcript

    • 1. Enterprise-Level Code Generation Matthew Fowler
    • 2. Agenda
      • Introduction
      • JeeWiz V4 - Process and Techniques
      • What's changed
      • JeeWiz V5 Worked Example
    • 3. NT/ e
      • NT/ e
        • New Technology / enterprise
        • Formed 1996
      • 1998 - Server-side Java. BEA Partners
      • 2006-7: £2.5m turnover, £100k profit
      • JeeWiz Version 1.0: March 2002
      • JeeWiz Version 5.0.9: June 2008
      • Key relationships: DeutschePost/SOPERA, BEA, GigaSpaces
    • 4. What's ELCG
      • Java, XML, Ant, Scripting
        • Develop on Windows, deploy on UNIX
      • Commercial/industrial
        • As opposed to defense/telecom (MDA)
        • Microsoft different too
      • Commercial drivers:
        • Opportunity: ROI, cost reduction, business agility
        • Defensive: stability, buy products, multiple stakeholders
    • 5. 2. JeeWiz V4 Process & Techniques
      • Meta-model
      • Build profiles
      • Model
      • XMI -> Simple XML
      • Generation
      • Writing code
    • 6. (2.1) Meta-modelling Features
      • Meta-model, meta-class, properties, lists
      • Validation - required, unique, Java expr
      • Factors - sort of mix-ins
      • Automatic generation of getters/setters/lists
      • Multi-level: i.e. "metaModel:metaClass" to reference across models
      • Add special methods in Java as XML CDATA
      • Lists for all descendants - class, b-o, entity
    • 7. Sample Meta-model
      • <meta-class name=&quot;entity&quot;
      • extends=&quot;attribute-collection&quot;
      • factor=&quot;security-factor&quot; >
      • <description>...</description>
      • <property name=&quot;table-name&quot; />
      • <property name=&quot;container&quot; />
      • <list name=&quot;query /&quot;>
      • <validator expression=&quot;!getStatic()&quot; message=&quot;An Entity must not be static&quot;
      • />
      • <![CDATA[
      • public int getPositionWithinParent()
      • {
      • return 30;
      • }
      • ]]>
      • </meta-class>
    • 8. Bottom line
      • Quick - 1-2% of effort on meta-modelling
      • Powerful
      • HTML/Eclipse docs generation
      • Even better when you don't have to use it
        • JeeWiz can generate without a meta-model
    • 9. (2.2) Build Profiles Base Java Bizobject Screen Collapse 1-level Meta-model filter.xml Customised Meta-model Filter RSM: JeeWiz.epx Format Universal Automated Powerful Flexible Universal Automated Powerful Flexible Universal Automated Powerful Flexible
    • 10. Build Profiles (cont.)
      • Filter allows
        • easy customisation
        • consistency with meta-model enhancements
      • Phase 3 changes for different modelling tool
        • same modelling profile across tools
    • 11. (2.3) Modelling
      • Logical-level concepts: e.g. page; event
        • All the platform representation is generated
      • High-value &quot;styles&quot;
        • multi-patterns for generating look/behaviour
        • intention hints, cross-cutting
      • RSM: automatic of deduction of stereotypes
        • Saves lots of fiddling and finger-trouble
        • Rewrite back to model possible
      • Tolerance: fill in the blanks with M2M
    • 12. Modelling Tolerance: Entity Key Generation
      • An example of technique + best practice
      #if( $keys.size() == 0 ) ### if there are no keys ### generate an autokey object on this entity <this> <attribute name=&quot;oid&quot; autokey=&quot;true&quot; type=&quot;Integer&quot; /> </this> #end
    • 13. Page Modelling in RSM
    • 14. Entity Modelling in RSM
    • 15. Modelling In Gigaspaces
    • 16. (2.4) XMI -> Simple XML
          • <entity name=&quot;Customer&quot;/> <attribute name=&quot;AcctID&quot; type=&quot;String&quot;/> </entity>
      • As simple as possible - it's all intentional
      • Lowest common denominator - for exchange
        • Use JeeWiz on any XML
        • On read-in, no meta-model needed
      • #foreach( $attribute in $entity.attributeList ) $attribute.name ... #end
      • CDATA in <class> carries code
    • 17. (2.5) Generation 1 - M2M
        • Automated design patterns, plus code
        • Same Enhanced Velocity: M2M Language = Velocity + XML
        • Output is Simple XML - feedback loop
          • No PIM/PSM dichotomy, no separate stage
        • Automatic building of result - no configuration
        • Separation of M2M from rendering to platform
        • 30:1 to 50:1 expansion of model
      Model (text) Model (Java objects) M2Text Code Config M2M + Velocity+ Velocity+ +
    • 18. Entity Key Generation - application of M2M #if( $keys.size() == 0 ) ### if there are no keys ### generate an autokey object on this entity <this> <attribute name=&quot;oid&quot; autokey=&quot;true&quot; type=&quot;Integer&quot; /> </this> #end
    • 19. Generation 2 - Automatic Build
      • &quot;Visitor&quot; Tree Walk
        • Manufacturing assemblies
        • Run ant if build.xml exists
        • No further configuration
        • Automatic build of M2M output
      • Ant - Model Integration
        • Read properties
        • Direct output to model
        • Side effects on model
      • Builds become components
      application name=&quot;Accounting&quot; ejb-jar name=&quot;Accounting1&quot; entity name=&quot;Account&quot; bean-managed=&quot;false&quot; attribute name=&quot;accountId&quot; type=&quot;int&quot; ejbJarList attribute name=&quot;title&quot; type=&quot;String&quot; entityList attributeList 1 2 3 4 5
    • 20. Generation 3 - M2Text
      • Called with special Ant task from a give object <jwVelocity template=&quot;applicationXml.vm&quot;
      • file =&quot;${staging}/META-INF/application.xml&quot;
      • />
      • Velocity script language
        • Well known, easy to use
        • Links to Java
      • JeeWiz additions:
        • Velocity methods
        • 240 Java helper methods
    • 21. Generated Architecture
      • HTML, CSS, JSP, Struts, some JavaScript
      • Session EJBs and Web Services
      • EJB 2.1 CMP
      • Application servers:
        • JBoss, Websphere, WebLogic, WebSphere
      • Databases: Oracle, SQL Server, MySQL
    • 22. (2.6) Writing Code
      • 3-7% by volume in WebApps
      • Written in base language - Java
      • Uses 'extends' strategy
      • Pluggable weaving implementations
      Implementation Code class Impl extends Base { } /* UID: ... */ int mImpl { ... } Generated Code class Base { } int mBase { ... mImpl(); }
    • 23. Application Page
    • 24. Application Page 2
    • 25. And Another Thing
      • CRUD generation
        • Relatively simple patterns
      • Data-views
        • Intermediate objects between DB and user/GUI or service API
        • Trees of objects, map to multiple database: a &quot;view&quot;
        • 25% of effort/volume
      • Antlr V3 Example - using JeeWiz as a compiler backend
    • 26. Summary: JeeWiz V4 - Process and Techniques
      • Modelling - precise, high-level, smart defaults
      • Fast iterations - supports reqts. discovery
      • Encoding of techniques, architecture, custom conventions, best practice
      • Automatic UI generation from abstract models
      • Coordinated multi-tier - 93-97% generation
        • Struts, J2EE, Web Services, mid-tier views
      • Commercial license, per-seat charge
      • Fundamentals known by millions of developers
    • 27. 3. What's Changed?
      • Version 5: Taking pluggability to another level
        • R&D grant commitment
      • Changes in the external world:
        • Virtualisation, clouds, SOA, grid computing
        • Hibernate/lightweight containers
        • Ajax, more Web frameworks than programmer
          • No longer &quot;One UI&quot;
      • Sopera - Eclipse &quot;Swordfish&quot; includes JeeWiz
    • 28. Problems
      • Cost of integration
        • New stack: Trinidad, JSF, Spring, Hibernate
        • The 500-page books are just the starting point
      • Multiple viable UI frameworks
        • Struts, Struts2, JSF, Javascript libraries, Seam
        • No clear winner
      • Making money - the value chain
        • Too much technology, too little time
    • 29. Ecosystem relationships Technology Provider Partner JeeWiz.com End-user Language/ region Partner Add-on Technology Provider Partner Value-add Partner (SI, Appln Product) JeeWiz.org e.g. Hibernate e.g. Ajax Library
    • 30. 4. JeeWiz V5 Worked Example
    • 31. (4.1) A Framework for Software Factories
      • What is a control?
      • A non-model object
      • Properties
      • Velocity methods
      • Normal overriding/inheriting
      • Used for details
      Base Java Business Objects Persistence Hibernate Database Screen JBoss4 JSF Demo Custom Meta-Model System Properties Per-object Properties M2M M2Text Controls
    • 32. Ant representation
      • templateDir=${basedir}/control,
      • ${jwhome}/resources/demo/control,
      • ${jwhome}/resources/jsf/control,
      • ${jwhome}/resources/jboss4/control,
      • ${jwhome}/resources/screen/control,
      • ${jwhome}/resources/${database}/control,
      • ${jwhome}/resources/hibernate/control,
      • ${jwhome}/resources/persistence/control,
      • ${jwhome}/resources/bizobject/control,
      • ${jwhome}/resources/java/control,
      • ${jwhome}/resources/base/control
      • Abstract layers versus implementation layers
        • Factor out PIM-level implementation
      • Other aspects of configuration pulled in from know files
    • 33. (4.2) Problem Statement Attribute type=String DB Column BigInt Presentation - (nnnnn) mmm mmm User View Programmer View ORM View ? Database View Java-to-SQL-type String Long
    • 34. The Framework Angle
      • Split of Reponsibities
      • Persistence javaSqlType
      • ORM-independent knowledge
      • based on datatype
      • Hibernate javaSqlType
      • Mapping datatype->ORMtype
      • Persistence javaSqlTypeConverter
      • Wrap expressions in statements
      • Custom javaSqlTypeStringLong
      • Map String to Long
      Base Java Business Objects Persistence Hibernate Database Screen JBoss4 JSF Demo Custom Meta-Model System Properties Per-object Properties M2M M2Text Controls javaSqlType javaSqlType javaSqlTypeConverter javaSqlTypeStringLong
    • 35. The Custom Control
      • #extends( javaSqlTypeConverter )
      • languageType = Long
      • isNumeric = ${booleanTrue}
      • toSqlException = NumberFormatException
      • #method( toSqlExpression- $attribute $var )
      • #return( &quot;Long.parseLong( $var )&quot; )
      • #end
      • #method( fromSqlExpression- $attribute $var )
      • ## flesh this out to 11 characters - use String formatter
      • #return( &quot;String.format( ${q}%011d${q}, $var )&quot; )
      • #end
      • #method (getInternalTypeFromRS $resultsSet $col $attribute)
      • #return( &quot;${q}${q} + ${resultsSet}.getLong( $col )&quot; )
      • #end
      (There's not much fluff here)
    • 36. Control Types Physical DataTypes Logical DataTypes Java-SQL Types Logging Database Java-SQL Types (Hibernate Extn) Language Database (Hibernate Extn) UI Field UI Search Field UI Navigation Lookups - Style, datatype UI State Conversation management, stacking UI Field (JSF/Trinidad) UI Search Field (JSF/Trinidad) UI Navigation (JSF/Trinidad) UI State (JSF/Trinidad)
    • 37. UI End... Attribute type=String DB Column BigInt Presentation - (nnnnn) mmm mmm User View Programmer View ORM View ? Database View (00000) 000 000 00000000000
    • 38. The uiFieldPhoneNumber Control
      • Similarity to java-Sql converter:
      • #extends(uiFieldDisplayConverter )
      • toUiException = RuntimeException
      • #method(toUiStatements- $attribute $var )
      • ...
      • #end
      • #method( fromUiStatements- $attribute $var )
      • ...
      • #end
      • Minimal amount for enhancer to write
      • Easy basics; easy to copy - commercially viable
    • 39. (4.3) Commercial
      • What we're doing is building a framework so that people can add in their own set of controls
        • JeeWiz : Generic UI Controls Architecture
          • e.g. selection by name, or datatype, or style
        • JSF Guru: JSF basic; Custom converters etc.
        • Apache Trinidad : Trinidad controls
        • Ajax Library : Ajax controls, Javascript Library
        • VARs/End users : Override with local style
      • On the Web today - jeewiz.org
    • 40. End

    ×