Wikia

Delphi Programming

Enterprise Core Objects

Talk0
2,909pages on
this wiki

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.

ModelingEdit

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.


ECO Class diagram


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


ECO State diagram


Object persistenceEdit

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.

Object Constraint LanguageEdit

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


ECO OCL editor


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 interfaceEdit

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%'))".


ECO UI binding


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

ConclusionEdit

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.

Further readingEdit

ECO downloads Edit

ECO Video Edit

References Edit

  1. ECO State Machines
  2. Using an existing enterprise database with Borland® ECO™
  3. Using the Object Constraint Language with ECO
  4. Getting a handle on the ECO Handles
  5. Using Borland ECO with Developer Express controls
  6. Report Writing for an ECO Application

Around Wikia's network

Random Wiki