CapableObjects ECO (short for Enterprise Core Objects™) is an Object Relational Mapper(ORM) and application framework. It's designed to significantly increase developer's productivity providing them with the following facilities:
- Object-relational mapping for persisting domain objects
- UML modeling of domain classes
- Executable State Machines for modeling behavior in UML notation
- Object Constraint Language and LINQ as means of making queries (in-memory or to DB)
- In-memory transactions and Undo/Redo functionality
- Easy binding with UI layer by .NET data binding support
ECO is targeted to .NET Framework, its predecessor was BOLD for Delphi created by Boldsoft.
As in true model-driven environment model is a central part of an ECO application. The developer alters the model and the changes are applied automatically to the underlying implementation. This allows developers to concentrate on the problem domain model instead of drowning in the implementation specifics. In particular there is no need to take care of database design that makes ECO applications more object-oriented and less database-oriented. Model construction in ECO is done in visual UML editor. The corresponding code is generated on the fly in either C# or Delphi.NET languages.
There are two model types supported by ECO: Class diagrams and State diagrams. Class diagrams are used to define static description of a system. On the other hand state diagrams describe possible states of an object and transitions between them. Thus state diagrams describe behavioral aspects of a system.
ECO performs object-relational mapping based on metadata which is taken from the model or from xml file. It implements such advanced object persistence features as caching, lazy load and others. Mapping scheme is enough configurable to use ECO with existing databases. Database reverse engineering wizard as a part of ECO helps with this task.
Since ECO keeps track of all unsaved changes to the objects it is easy to propagate these changes to the persistent storage:
And it is simple to load some objects from the persistent storage:
IObjectList people = ECOSpace.OclService.Evaluate("Person.AllInstances");
Here we use "Person.AllInstances" OCL expression. Go on reading to see what it is.
Object Constraint Language
OCL is often referred to as an object analog for SQL. And indeed it is quite convenient to make OCL queries in terms of objects. For example the following expression gets company employees older than 30 years: "company.employees->select(age > 30)". Originally OCL was proposed by OMG as a means of describing constraints in UML models. But actually the usage area of OCL is much wider. In ECO OCL is used to express:
- Queries to the DB
- In-memory queries
- Evaluation expressions for derived class members
ECO uses its own OCL editor with syntax check and expression assistant. This makes writing OCL expressions in ECO easy and safe.
Since OCL is side-effect free language it does not allow making changes to a system. That is why ECO team came up with an extension to OCL called EAL (ECO Action Language). EAL makes it possible to change object's members, to call methods and even to create new object instances. Sometimes it is handy to write state machine trigger effect or a class method with EAL instead of using standard C# or Delphi.NET language.
Binding to user interface
ECO contains components for easy linking user interface controls to the domain objects. These components are so called handles. There are different types of handles in ECO. One of the most useful is expression handle which allows populating user interface controls with the results of an OCL expression. For example it is possible to show all people with name containing "John" by a handle with following expression: "Person.AllInstances->select(fullName.sqlLike('%John%'))".
By making use of .NET data binding architecture ECO allows binding to any .NET controls including third-party visual components. There are several examples of how to use ECO with some popular user interface component libraries.
CodeGear Enterprise Core Objects™ is all-in-one solution for enterprise development. It unites ORM framework, UML modeling tool with instant code generation, OCL expression evaluator and other extremely useful facilities.
- Huge Documentation collection on Club Delphi
- Whitepaper on development with ECO
- ECO Tutorial (part 1) (part 2) (part 3)
- Introductory article to ECO by Peter Morris
- ECO resources list
- CodeGear Developers Network articles on ECO
- ECO developers’ team homepage
- ECO Newsgroup
- Alois Schmid's ECO Book
- ECO: Trade offs of "one file per class" by Olaf Monien
- Using Borland ECO with Developer Express controls by Oleg Zhukov
- ECO III: Using IOclService by Holger Flick
- ECO Tutorial - Felix COLIBRI