ECO (Domain Driven Design)
Encyclopedia
ECO, is a software framework
Software framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software...

 suited for Domain-Driven-Design
Domain-driven design
Domain-driven design is an approach to developing software for complex needs by deeply connecting the implementation to an evolving model of the core business concepts...

 (DDD) from Capable Objects AB, designed to increase productivity by utilizing facilities such as Object-relational mapping
Object-relational mapping
Object-relational mapping in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language...

 (ORM) for persisting domain objects, UML
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

 models for domain classes and executable State Machines for behavior control defined in UML notation. The ECO framework is intended to be an all-in-one solution for enterprise development and includes in-memory transactions
Transaction processing
In computer science, transaction processing is information processing that is divided into individual, indivisible operations, called transactions. Each transaction must succeed or fail as a complete unit; it cannot remain in an intermediate state...

 and Undo
Undo
Undo is a command in many computer programs. It erases the last change done to the document reverting it to an older state. In some more advanced programs such as graphic processing, undo will negate the last command done to the file being edited....

/Redo functionality as well as easy binding with UI layer. ECO unites ORM
Object-relational mapping
Object-relational mapping in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language...

 framework and UML modeling tools with instant code generation and an OCL
Object Constraint Language
The Object Constraint Language is a declarative language for describing rules that apply to Unified Modeling Language models developed at IBM and now part of the UML standard. Initially, OCL was only a formal specification language extension to UML. OCL may now be used with any Meta-Object...

 expression evaluator for simplified in-memory and DB queries, business rules and other useful facilities.

ECO5 is targeted to .NET Framework
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

 and is only available for development environment Visual Studio
Microsoft Visual Studio
Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

. Users of RAD Studio can still download ECO4.

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 which makes ECO applications more object-oriented and less database-oriented. Model construction in ECO is done in visual UML
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

 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 diagram
Class diagram
In software engineering, a class diagram in the Unified Modeling Language is a type of static structure diagram that describes the structure of a system by showing the system's classes, their attributes, operations , and the relationships among the classes.- Overview :The class diagram is the main...

s and state diagram
State diagram
A state diagram is a type of diagram used in computer science and related fields to describe the behavior of systems. State diagrams require that the system described is composed of a finite number of states; sometimes, this is indeed the case, while at other times this is a reasonable abstraction...

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

Object persistence

ECO performs object-relational mapping based on metadata which is taken from the model or from an xml file. It implements such advanced object persistence features as caching, lazy load and others. Mapping scheme is configurable enough to use ECO with existing databases. Database reverse engineering wizard as a part of ECO helps with this task.

ECO automatically keeps track of all unsaved changes to the objects and provides simple means for the programmer to propagate these changes to the persistent storage, for example using the following command:
ECOSpace.PersistenceService.UpdateDatabase;

Using OCL simplifies loading objects from the persistent storage. The example code below uses the OCL expression "Person.AllInstances" to load all instances of the class named "Person" in the UML model:
IObjectList people = ECOSpace.OclService.Evaluate("Person.AllInstances");

Object Constraint Languages

OCL
Object Constraint Language
The Object Constraint Language is a declarative language for describing rules that apply to Unified Modeling Language models developed at IBM and now part of the UML standard. Initially, OCL was only a formal specification language extension to UML. OCL may now be used with any Meta-Object...

 is often referred to as an object analog for SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

 since OCL
Object Constraint Language
The Object Constraint Language is a declarative language for describing rules that apply to Unified Modeling Language models developed at IBM and now part of the UML standard. Initially, OCL was only a formal specification language extension to UML. OCL may now be used with any Meta-Object...

 provides a means to make queries in terms of objects. ECO uses its own OCL editor with syntax check and expression assistant in order to simplify writing type safe OCL expressions. The ECO OCL
Object Constraint Language
The Object Constraint Language is a declarative language for describing rules that apply to Unified Modeling Language models developed at IBM and now part of the UML standard. Initially, OCL was only a formal specification language extension to UML. OCL may now be used with any Meta-Object...

 editor validates OCL expressions also against the actual model context. The following OCL expression selects company employee objects representing employees older than 30 years. If persisted object instances are not present in memory when the OCL expression is evaluated, they will be automatically loaded into memory by the ECO framework:
company.employees->select(age > 30)


Originally OCL was proposed by OMG
Object Management Group
Object Management Group is a consortium, originally aimed at setting standards for distributed object-oriented systems, and is now focused on modeling and model-based standards.- Overview :...

 as a means of describing constraints in UML
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

models, but the usage area of OCL is actually much wider. In ECO OCL is used to express:
  • Queries to the DB
  • In-memory queries
  • Evaluation expressions for derived class members (attributes and links)
  • Constraints

Standard OCL is a side-effect free language in that it doesn't allow making changes to a system. For this reason ECO has an OCL extension called EAL (ECO Action Language) which makes it possible to change an object member, to call methods and even to create new object instances. EAL provides a simple means to write state machine trigger effect or a class method instead of using standard C# or Delphi.NET language. OCL/EAL functionality can be defined directly in the UML model.

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

View models

One of the latest features in ECO is Viewmodels. It can be used to quickly prototype a GUI directly from a model. No code at all need to be written. Instead the model is used as base the developer can place components on a matrix. The prototype can then be run directly to get a feeling for he application. Data is loaded and saved in a xml-file. This model can then be used directly in an application for Winform or WPF.
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.

Further reading

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK