Segmenting definition and logic
No edit summary
m ((username removed) (log details removed))
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
ECO makes it easy to define models. To reuse a model you can simply import a ecopkg.
ECO makes it easy to define models. To reuse a model, simply import an ecopkg.


[[File:Segmenting 1.png|frameless|374x374px]]
[[File:Segmenting 1.png|frameless|374x374px]]


This will make the package part of your model and you can edit the contents of the package. Code generation will also create new code and empty stubs for code implemented operations.
This will make the package part of your model and you can edit its contents. Code generation will also create new code and empty stubs for code-implemented operations.


Normally you want to reuse the whole model assembly that may contain code implemented operations, maybe code derived attributes and relations and so on.
You usually want to reuse the whole model assembly that may contain code-implemented operations, maybe code-derived attributes and relations, and so on.


To do this you choose the “Edit referenced packages” option instead:
To do this, choose the “Edit referenced packages” option instead:


[[File:Segmenting 2.png|frameless|411x411px]]
[[File:Segmenting 2.png|frameless|411x411px]]


Then choose “Add” and find a ecopkg you want to use as part of your complete model:
Then choose “Add” and find an ecopkg you want to use as part of your complete model:


[[File:Segmenting 3.png|frameless|346x346px]]
[[File:Segmenting 3.png|frameless|346x346px]]


In this post I choose the EcoAspProvider.ecopkg that comes with the ECO install. This package implements the membership functions for ASP.NET as eco objects.
In this post, I chose the EcoAspProvider.ecopkg that comes with the ECO install. This package implements the membership functions for ASP.NET as eco objects.


When referencing a package like this, the classes in the package are made read only. You can still draw associations to and from the classes in referenced packages as long as the association end is not embedded in any read only end. In other words: you can point out read only classes, but you cannot make a read only class point out anything new. Give this some thought and you will probably find it very intuitive; the external, referenced, definition cannot be changed in this context.
When referencing a package like this, the classes in the package are made read-only. You can still draw associations to and from the classes in referenced packages as long as the association end is not embedded in any read-only end. In other words: you can point out read-only classes, but you cannot make a read-only class point out anything new. Give this some thought and you will probably find it very intuitive; the external, referenced, definition cannot be changed in this context.


A referenced package is NOT code generated with the rest of the model. The referenced package probably comes with a compiled assembly or project of its own that use the definition in runtime. Add a reference to this as you would do with any other externally defined logic in .net:
A referenced package is NOT code generated with the rest of the model. The referenced package probably comes with a compiled assembly or project of its own that uses the definition in runtime. Add a reference to this as you would do with any other externally defined logic in .net:


[[File:Segmenting 4.png|frameless|362x362px]]
[[File:Segmenting 4.png|frameless|362x362px]]


If you try to change a property of a referred package ECO will stop you: 
If you try to change a property of a referred package, ECO will stop you: 


[[File:Segmenting 5.png|frameless|424x424px]]
[[File:Segmenting 5.png|frameless|424x424px]]


To make your solution use the referred package you must click the choose package icon in the ecospace designer
To solve this, use the referred package. You must click the choose package icon in the ecospace designer.


[[File:Segmenting 6.png|frameless]]
[[File:Segmenting 6.png|frameless]]
Line 35: Line 35:
[[File:Segmenting 7.png|frameless|390x390px]]
[[File:Segmenting 7.png|frameless|390x390px]]


Then make sure you generate code and build your solution before you generate the schema (the schema is derived from the runtime model that is derived by looking on the code alone)
Ensure you generate code and build your solution before you generate the schema (the schema is derived from the runtime model that is derived by looking at the code alone).
[[Category:ECO]]
[[Category:ECO]]
[[Category:Advanced]]
[[Category:Advanced]]

Latest revision as of 06:44, 11 January 2024

ECO makes it easy to define models. To reuse a model, simply import an ecopkg.

Segmenting 1.png

This will make the package part of your model and you can edit its contents. Code generation will also create new code and empty stubs for code-implemented operations.

You usually want to reuse the whole model assembly that may contain code-implemented operations, maybe code-derived attributes and relations, and so on.

To do this, choose the “Edit referenced packages” option instead:

Segmenting 2.png

Then choose “Add” and find an ecopkg you want to use as part of your complete model:

Segmenting 3.png

In this post, I chose the EcoAspProvider.ecopkg that comes with the ECO install. This package implements the membership functions for ASP.NET as eco objects.

When referencing a package like this, the classes in the package are made read-only. You can still draw associations to and from the classes in referenced packages as long as the association end is not embedded in any read-only end. In other words: you can point out read-only classes, but you cannot make a read-only class point out anything new. Give this some thought and you will probably find it very intuitive; the external, referenced, definition cannot be changed in this context.

A referenced package is NOT code generated with the rest of the model. The referenced package probably comes with a compiled assembly or project of its own that uses the definition in runtime. Add a reference to this as you would do with any other externally defined logic in .net:

Segmenting 4.png

If you try to change a property of a referred package, ECO will stop you: 

Segmenting 5.png

To solve this, use the referred package. You must click the choose package icon in the ecospace designer.

Segmenting 6.png

Then make sure that all packages you want to use are selected:

Segmenting 7.png

Ensure you generate code and build your solution before you generate the schema (the schema is derived from the runtime model that is derived by looking at the code alone).

This page was edited 128 days ago on 01/11/2024. What links here