CodeGear ECO

From Wikipedia, the free encyclopedia

Enterprise Core Objects
Developed by Borland Corporation, CodeGear Company, CapableObjects AB
OS .NET Framework / Microsoft Windows
Genre Software framework
Website http://www.codegear.com/, http://www.capableobjects.com

CodeGear ECO (short for Enterprise Core Objects) is a Model-Driven Architecture implementation by CodeGear company, currently maintained by CapableObjects company. It is 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
  • OCL as a 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 and is shipped as a part of CodeGear development environments such as C#Builder or Delphi.

Contents

[edit] Modeling

A 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[1].


[edit] Object persistence

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[2].

Since ECO keeps track of all unsaved changes to the objects it is easy to propagate these changes to the persistent storage:

        ECOSpace.PersistenceService.UpdateDatabase();

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.

[edit] 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
  • Constraints

ECO uses its own OCL editor with syntax check and expression assistant. This makes writing OCL expressions in ECO easy and safe[3].


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.

[edit] Binding to user interface

ECO contains components for easy linking user interface controls to the domain objects. These components are so called handles[4]. 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[5][6].

[edit] Conclusion

CodeGear Enterprise Core Objects is all-in-one solution for enterprise development[citation needed]. It unites ORM framework, UML modeling tool with instant code generation, OCL expression evaluator and other extremely useful facilities.

[edit] Further reading

[edit] References

Languages