Top Banner
1 Getting Started with Code Generation In An Enterprise Matthew Fowler [email protected]
27
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

1

Getting Started withCode Generation In An Enterprise

Matthew [email protected]

Page 2: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

2

Agenda

• Who's Who• JeeWiz Introduction• Demonstration• Benefits

Page 3: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

3

• Global Financial Operating Division, 20k employees

• Security Identity and Access Management (IAM)

• Web Services + Web Application

Who's Who - The Customer

HR SystemApplication/

RulesRepository

ApplicationAuthent.

Authorisn.

Reqts.

Status

Joiners,leavers

Page 4: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

4

Who's who - NT/e

• J2EE Technical Services– Architecture, trouble-shooting, development– Supply of development staff and projects

• JeeWiz System Generator– J2EE - Struts, EJB, Web Services– High levels of generation

Page 5: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

5

Application Framework

Model BusinessLogic

Platform Server

DeployedApplication

BusinessAnalyst

Meta-Programmer

ApplicationProgrammer

JeeWiz Process

Project & Build Jobs

LocalVariations

Meta-Programs

Page 6: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

6

NT/e J2EE Customers

         

             

Page 7: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

7

Phase 1

• Customer's Business Goals– Improve governance, protect credit rating– Clarify detailed business process– Reduced cost/timescales– Reduced risk - fixed price– Explore large-scale MDA/MDD technology

• NT/e's goals– Prove the technology and business proposition– Open up another enterprise customer– Make some money (or not lose too much)

Page 8: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

8

Technical environment

• Java/J2EE– Java– Business objects meta-model

(E-R, DAOs, services, facades)– Screens (pages, events, page flow)– J2EE (incl. Struts, JSP, JSTL)– WebSphere 5 specifics

• Web Services, deployment descriptors

• Oracle DateTime!

– Company-specificJava

Bizobject

Screen

J2EE

WebSphere

Company

Page 9: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

9

Entity Modelling in RSM

Page 10: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

10

The Original Plan

• "You do the work – but informally bring us up to speed"

• Developer-developer interface• Significant support from customer:

– volumetrics, document templates, L&F standards,UAT envt., database setup, equipment, timely reviews, build/deploy standards

• Fast Agile Development– Ready for UAT in 2 months

Page 11: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

11

The Reality

• Requirements and Functional Specs– Guessed by customer dev team– Then re-verified with business unit

• Dependencies all missed– Very few standards and procedures

• Demonstration of finished application - 2 months• Reqts&FS signed off - 3 months• Development/UAT finished - 8 months• Formal Acceptance - 1 year

Page 12: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

12

Statistics - Phase 1

• Input:Model 376 kbBusiness Logic 393 kb 39 files

Generated 14.4 Mb 1295 files• 97% generation

Page 13: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

13

Hard Lessons

• Fixed price for long projects is bad news– Customer determination to get value for money

destroyed the short-term value– Front-end benefits of JeeWiz were forgotten

• Huge organisational learning on both sides– The hidden investment in the relationship

• Customer priorities no effective learning of JeeWiz

Page 14: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

14

Positive Outcomes

• WebSphere 5 Automation– Database descriptors– Web Services build; no change in model– Integration with WSAD/customer build jobs

• Asynchronous processing framework• Customer-specific Software Factory

– Customised UI, logging, security, build

Page 15: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

15

Phase 2

• "Now the business understands better..."• Manual upload from WebApp

– Tactical de-emphasis of web services– Complex "Dashboards" for administrators and

support personnel– 10 new pages, 4 changed pages– 7 new database tables, with CRUD

• Integrate WebApp into asynch processing– shared with Web Services

Page 16: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

16

Dashboard Modelling in RSM

Page 17: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

17

Contractual Changes

• T&M• "Specification": mock-up of web pages & flow• No substantive changes

– Customer in a hurry

• The Phase 1 investment in the relationship pays off:– Minimal contractual overhead– No specification arm-wrestling– Win-win project situation.

Page 18: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

18

Productivity Modelling

• 6 man-days modelling ... produced– 11,000 lines, working and unit tested

• Java

• JSP

• Config changes

• 45 man-days, design → system test, documented– 11,000 lines generate– 2,800 lines new functionality– 2,800 modified– 350 lines per day

Page 19: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

19

Result

• Perception change– From: Not sure JeeWiz adds anything– To: Definitely couldn't have done it in the same time

• On time, on budget– minor changes in spec, absorbed into planned time

• Generation %:– Additional/modified code: 80% generated

• Refactoring of existing backend logic

– Overall: 95% generated

Page 20: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

20

Phase 3

• Bring skill in-house– Reduce cost of maintenance– Give the team leader a new toy to play with

• Create another complex new page• Integrate with WSAD development

– Fast turnaround with integrated WebSphere

• Integrate with CM and Deployment tools

Page 21: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

21

Commercial

• Consultancy/mentoring input only• Adoption of JeeWiz by customer• Team leader changed generation system

– build and deploy scripts to create WSAD projects– complex new pages (Assign Accounts & relations)– new modelling terms (page type)– page style generation, field rendering overrides

• 8 weeks part-time

Page 22: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

22

Result

• Maintenance of application passes to customer• Customer has in-depth knowledge of all levels of

JeeWiz• Learning curve for meta-programming

– Modelling, profile changes: minimal– Mechanics of meta-programming (XML, Java,

Velocity, Ant): minimal– Meta-programming system internals: steep

• But programming in WSAD, reverse into JW

Page 23: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

23

Phase 4 - Variant Application

• Different department– But similar business requirements

• Big rush• New model - mostly subset of Phase 3

– Remove Web Services– Remove some file upload– Detail changes, new pages for usability– Add Email chasing workflow

Page 24: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

24

Commercial

• Delivered by NT/e– In-house capability on other priorities

• Approx 40% effort on deployment– (Task previously done by customer)

Page 25: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

25

Results

• Separation of concerns– Double-teaming possible– Parallel development of model, meta-programs and

application programming

• Fast generation of variant application– Easiest to prune the model and rebuild

• Generated files reduced by 20%

– 8 new implementation files (new pages, Email)

Page 26: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

26

Late-breaking news

Page 27: 1 Getting Started with Code Generation In An Enterprise Matthew Fowler matthew.fowler@nte.co.uk.

27

Conclusions

• JeeWiz stands up well• Customer can quickly build WebApps (new skill)• Maintenance phase benefits

– Pre-existing "software factory" reuse– Efficiency increases with time

• Agile process fits better– Waterfall takes too long to get business value– Fixed-price chunks, T&M for deployment better

• Big cultural learning curve