ECO Boot Camp - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

ECO Boot Camp

Description:

Lot's of plumbing code to be written. Objects - DB. UI - Objects. Collections ... interact with these classes in other diagrams. Example. Model Summary ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 42
Provided by: malcolm47
Category:
Tags: eco | boot | camp | diagram | plumbing

less

Transcript and Presenter's Notes

Title: ECO Boot Camp


1
ECO Boot Camp
  • Malcolm Groves
  • mgroves_at_borland.com

2
Agenda
  • Overview
  • Model
  • Classes, Attributes, Methods, Associations
  • Derived Attributes OCL, Code, Reverse Derived
  • Derived Associations
  • Association Classes
  • ECO Packages

3
Agenda
  • ECOSpace
  • Persistence
  • Transactions
  • User Interface
  • ReferenceHandle, ExpressionHandle,
    CurrencyManagerhandle
  • Variables
  • Forms
  • Extender Components

4
Agenda
  • ECO II
  • Other Resources

5
ECO Overview
6
Database-Driven Development
7
Database-Driven Development
  • Advantages
  • Familiar
  • Low barrier to entry
  • Disadvantages
  • Typically, low cohesion of business logic
  • Maintenance

8
Model-Driven Development
9
Model-Driven Development
  • Advantages
  • Maintenance
  • Documentation
  • Higher Cohesion of Business Logic
  • Disadvantages
  • Higher barrier to entry
  • Lots of plumbing code to be written
  • Objects lt-gt DB
  • UI lt-gt Objects
  • Collections

10
Enterprise Core Objects
  • ECO is still Model-Driven Development
  • More automation
  • Database Mapping
  • UI Mapping
  • Associations
  • OCL in your model
  • Derived Attributes, Associations
  • Constraints
  • Services
  • Undu/Redo, AutoForms, etc

11
ECO
  • Advantages
  • Maintenance
  • Productivity
  • Nice, clean separation of concerns
  • Disadvantages
  • Requires a little bit of a mindset change
  • Addictive ?

12
Demo
  • ECO Overview

13
Remember
  • Dont lose sight of the fact that you are still
    just designing Delphi classes

14
Model Basics
  • Example
  • Classes
  • Attributes
  • Operations
  • Associations
  • Generalization

15
Beyond the Basics
16
Derived Attributes
  • Sometimes, an attribute is not simply some value
    stored in a database
  • Eg Rect.Area Rect.Width Rect.Height
  • Similar to Calculated Fields in TTable
  • How to derive the value?
  • OCL (Object Constraint Language)
  • Code

17
Derived Attributes
  • Examples
  • Using OCL to derive an attributes value
  • Using Code to derive an attributes value
  • Overriding Derived Attributes
  • Reverse Derived Attributes

18
Derived Associations
  • Sometimes an Association can be calculated from
    another
  • Eg. Customer.Accounts gt Customer.OverdueAccounts
  • Use OCL to return the other end of the
    association
  • Example

19
Question
  • Where would you put a StartDate attribute?
  • On the Person?
  • What happens when they get a new job? Or have two
    jobs?
  • On the Company?
  • What happens when the Company hires a second
    person?
  • On the Association?

20
Association Classes
  • Association Classes let you place attributes,
    methods, etc on an association
  • Extremely flexible, powerful concept
  • Once you start using it, it will explain a whole
    bunch of problems you used to experience.
  • Example

21
Association Classes
  • On the Model

22
Association Classes
  • In Sourcecode

23
UML Packages
  • Default behaviour of ECO is to put all domain
    classes in a single file
  • Not very good for Team Development
  • Not very good for manageability
  • UML Packages let you group related classes
    together in separate files
  • Shortcuts let you still interact with these
    classes in other diagrams
  • Example

24
Model Summary
  • Classes, Attributes, Methods, Associations
  • Derived Attributes OCL, CODE, Reverse Derived
  • Derived Associations
  • Association Classes
  • ECO Packages

25
EcoSpace
  • Runtime container for your objects
  • Manages
  • Object Lifecycle (ie. it creates, and destroys
    your objects)
  • Persistence
  • Executes OCL
  • Object Transactions
  • Etc

26
ECOSpace
Fred Person
Mary Person
ABC123 Invoice
Mary Person
ABC123 Invoice
ABC123 Invoice
Depends on the Datastore chosen
27
Services
  • Persistence
  • Relationships
  • Transactions
  • Subscriptions
  • Caching
  • Querying
  • Undo / Redo
  • Versioning

28
Persistence
  • PersistenceMapper component
  • XML
  • BDP
  • SQLServer
  • ECOSpace.UpdateDatabase
  • Transient Objects
  • Example

29
Transactions
  • Nothing to do with Database Transactions, these
    are Object Transactions
  • Used in a similar fashion to DB Transactions
  • EcoSpace.UndoService.StartTransaction
  • try
  •   // Code that does stuff to objects here
  •   EcoSpace.UndoService.CommitTransaction
  • except
  •   EcoSpace.UndoService.RollbackTransaction
  •   raise
  • end

30
User Interface
31
Handles
  • ReferenceHandle
  • Connection between your UI Controls and your
    ECOSpace
  • ExpressionHandle
  • Executes OCL and returns one or more values
  • Implements IList so can be used as a DataSource
    for Databinding

32
Handles
  • CurrencyManagerHandle
  • Acts as a cursor into a collection of Objects
  • Example
  • VariableHandle
  • Allows you to create dynamic OCL
  • Example

33
VariableHandle Flow of Components
34
ECO From Sourcecode
  • Creating an Object
  • Getting a Reference To The Currently Selected
    Object
  • Creating Objects Part 2
  • Executing OCL from Code

35
Forms
  • AutoForms
  • ECO can automatically generate a form based on
    the model
  • Great during development, you probably wouldnt
    deploy them ?
  • Custom Forms
  • Custom Auto Forms

36
Extender Components
  • Delphi 8 ECO ships with a number of components to
    remove the need for common coding
  • ECOAutoFormExtender
  • ECOActionExtender
  • ECOListActionExtender
  • ECODragDropExtender
  • Like anything, use them once you know what they
    do for you.

37
Summary
  • Model
  • Classes, Attributes, Methods, Associations
  • Derived Attributes OCL, Code, Reverse Derived
  • Derived Associations
  • Association Classes
  • ECO Packages
  • ECOSpace
  • Persistence
  • Transactions
  • User Interface
  • ReferenceHandle, ExpressionHandle,
    CurrencyManagerhandle
  • Variables
  • Forms
  • Extender Components

38
But wait, theres more
  • This was an introduction
  • Should be enough for you to start exploring
  • ECO is very rich, and there is plenty for you to
    get into
  • Constraints, Subscriptions, other Services,
    Optimistic Locking,
  • ECO II is even richer

39
ECO II
  • Ships in Diamondback
  • Everything you learned today is still applicable
  • Adds
  • ASP.NET Support (Web Forms and Web Services)
  • Legacy Database Support
  • Synchronization Server
  • Concurrency
  • Improved Designer
  • Come to Monday night Meet the Delphi Team for a
    Sneak Preview

40
Other Resources
  • My Blog
  • http//blogs.borland.com/malcolmgroves
  • ECO Tutorials
  • http//www.borland.com/delphi_net/architect/eco/tu
    torial/
  • Christophe Flourys Technical Whitepaper
  • http//www.borland.com/products/white_papers/del_u
    nleashing_enterprise_models_with_delphi_for_dotnet
    .html

41
Other Resources
  • Newsgroups
  • borland.public.delphi.modeldrivenarchitecture.eco
  • borland.public.csharpbuilder.modeldrivenarchitectu
    re.eco 
Write a Comment
User Comments (0)
About PowerShow.com