Presentation is loading. Please wait.

Presentation is loading. Please wait.

March 12 & 13, 2007 Practical Code Generation Peter Bell SystemsForge.

Similar presentations


Presentation on theme: "March 12 & 13, 2007 Practical Code Generation Peter Bell SystemsForge."— Presentation transcript:

1 http://europe.cfunited.com/http://europe.cfunited.com/ March 12 & 13, 2007 Practical Code Generation Peter Bell SystemsForge

2 March 12 & 13, 2007http://europe.cfunited.com/ Overview Who am I? Why Listen? Problems to solve Potential solutions Domain Specific Languages Software Product Lines Code Gen/Frameworks Next Steps

3 March 12 & 13, 2007http://europe.cfunited.com/ Who Am I? Programmer - 30-40 projects/yr. Researcher - Published academic papers DSM forum/ooPSLA Entrepreneur - Profitable/practical SystemsForge - 10,000 custom apps/yr. Writer - CFDJ, Fusion Authority Quarterly Presenter - cf.objective(), CF United, Frameworks, Code Generation 2007, ooPSLA, Domain Specific Modeling Forum, CFCamp...

4 March 12 & 13, 2007http://europe.cfunited.com/ Why Listen? Companies are reporting 5-10x faster development using Domain Specific Languages and Software Product Lines You’re already doing these things A few concepts will help you to do them better

5 March 12 & 13, 2007http://europe.cfunited.com/ Calibration Have you: Written OO code? Heard of DSLs? Written a DSL? Heard of SPLs Created a SPL?

6 March 12 & 13, 2007http://europe.cfunited.com/ Problems OO coding is slow Changes are painful Reuse is difficult

7 March 12 & 13, 2007http://europe.cfunited.com/ OO Coding is Slow ProductService.cfc ProductDAO.cfc Product.cfc tbl_Product ColdSpring/Lightwire config Admin controller/views Front end controller Catalog.cfc Front end views ProductList.cfm, ProductDetail.cfm Add Products to site...

8 March 12 & 13, 2007http://europe.cfunited.com/ Changes are Painful Add services from tbl_Service to product catalog Products -> multiple categories Change form error handling (error list to in-form display)

9 March 12 & 13, 2007http://europe.cfunited.com/ Re-use is Difficult Libraries/utility components/cut and paste/snippets - usually OK Problem with cfc reuse is usually cross cutting concerns: Logging Error handlers Notification services Other dependencies...

10 March 12 & 13, 2007http://europe.cfunited.com/ Solving Same Problems Solutions Content management Workflow Shopping carts Techniques Form processing DB access Paginated lists Reporting Imports/Exports

11 March 12 & 13, 2007http://europe.cfunited.com/ Potential Solutions Code quicker - DSL Maintain easier - DSL Re-use better - SPL

12 March 12 & 13, 2007http://europe.cfunited.com/ Domain Specific Language “An executable language targeted to a specific problem domain” Specific - can’t do everything Executable - not just conceptual Raising level of abstraction

13 March 12 & 13, 2007http://europe.cfunited.com/ Types of DSLs Horizontal (tech focused) SQL RegEx Import description language General workflow language Vertical (business focused) Insurance policy language Product configuration language Academic requirements language

14 March 12 & 13, 2007http://europe.cfunited.com/ Types of DSLs - Internal Custom tag API UserService.import("test.csv", ",", "FirstName,LastName,Email", "tbl_User", "update"); Method Chaining User.IsValid.FirstName()

15 March 12 & 13, 2007http://europe.cfunited.com/ Types of DSL - External Comma delimited "test.csv", ",", "FirstName,LastName,Email", "tbl_User", "update" XML Databased “Little Language” Import test.csv using commas update tbl_User with FirstName,LastName,Email Visual

16 March 12 & 13, 2007http://europe.cfunited.com/ DSL Key Concept Abstract Grammar vs. Concrete Syntax What you say vs. How you say it User @FirstName FirstName

17 March 12 & 13, 2007http://europe.cfunited.com/ Example DSL Product extends: BaseObject tableName: tbl_Product Identity: ProductID Properties: Title title required Price money optional default:0 Description WYSIWYG optional ClassMethods: AdminList: Title,Price OrderBy Title DefaultAdd: Title,Price,Description QuickAdd: Title,Price multiple:5 DefaultEdit: ID, Title,Price,Description Relationship has-many Category associated optional

18 March 12 & 13, 2007http://europe.cfunited.com/ Benefits of DSLs More concise (less to write/edit) Can add constraints MAY be end user editable

19 March 12 & 13, 2007http://europe.cfunited.com/ Software Product Lines Design a collection of applications Bounded and unbounded variability Bounded: feature model/configuration Unbounded: DSLs Extension points

20 March 12 & 13, 2007http://europe.cfunited.com/ Code Gen/Framework Both use DSLs Compiled/interpreted Late bound decision

21 March 12 & 13, 2007http://europe.cfunited.com/ Next Steps Multiple Applications? Plan variability Feature model Configuration options DSLs Generators/framework Single Application? Reusable services Raise abstraction levels DSLs: Custom tags, APIs, external config files, CMSs, visual editors (Eclipse EMF)

22 March 12 & 13, 2007http://europe.cfunited.com/ 22 Questions? Blog:  www.pbell.com www.pbell.com Email:  peter@pbell.com peter@pbell.com Yahoo:  freshstartsw freshstartsw AIM:  appgeneration appgeneration


Download ppt "March 12 & 13, 2007 Practical Code Generation Peter Bell SystemsForge."

Similar presentations


Ads by Google