HighTechTalks DotNet Forums  

Re: Input needed, using lazy load with business entities

Dotnet Distributed Applications microsoft.public.dotnet.distributed_apps


Discuss Re: Input needed, using lazy load with business entities in the Dotnet Distributed Applications forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
TEK
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 06-25-2003 , 09:38 AM







"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
I don't know how big your project is, but for mine I'm really considering
investing in an O/R tool because I'm not sure I have the time to deal with
the issues involved with BEs. I'm not suggesting a tool will solve them
all, but hopefully it'll cut down the amount of work I have to do.

It's an inhouse product. I have looked at some of the O/R tool generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a clean object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one of the OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in combination with
base classes to auto generate the data-layer and business entities, while
all the additional business logic will be handled by the business layer
(which is written manually).
The data layer will handle all saving and loading of objects, and will also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation using
XML/Stylesheets saves me a lot of work, and at the same time I'm able to get
the stuff the way I want it, not the way the person that created the tool
though I wanted it.

Regards, TEK

Quote:
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business entities, UserInfo
may
for example hold an collection of GroupInfo objects. (the groups a user
is
member of).

So to the issue, with large listings (for example when calling
user.GetAllUsers()), you may only need/want the basic information, not
the
connected info objects.
Normally, a logical way to solve this would be to implement layze
loading,
meaning that the users Group would not be filled until the calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a reference to the
Business logic components, and wholia, a sircular reference.
At the same time that would lead to put business logic into the info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK







Reply With Quote
  #2  
Old   
TEK
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 06-26-2003 , 02:42 AM






"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:Olqpf%23yODHA.3152 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Quote:
Interesting mechanism your using here. So essentially you use metadata to
generate your mappers and business entities?
Yes. The code to for example define a entity object with one single property
in my xml file would be:
<class name="MyObject" table="tdmyobject">
<property name="Name" type="String" required="yes" dbcolum="name"
findbyone="yes" findbymany="yes"/>
</class>

This would (through a stylesheet) resolve to:
Info class name MyObjectInfo with:
- Get/set method (or getters/setters if you like that better ;-)
- Member variable
- Constructor requiering name as a property
- Mapping info (property values and table columns + table name)

A strong typed collection class named MyObjectInfoCollection

a DataLayer class with
- a CreateFromReader method that uses a SqlDataReader and the constructor to
instanicate the info object
- a FindMyObjectByName() method
- a FindMyObjectsByName(criteria) method

There is also special support for properties referring to others Info
objects (are automatically loaded and instanciated by the datalayer) and
InfoCollections (also automatically loaded as well)

and lot more...
All generted classes is inherited from bases classes, so that it's easy to
add complex fetures without haveto autogenerate all of it...



Quote:
Are you saying that your BEs don't have any logic in them?
No business logic, but they do have some logics:
Their are supporting IClone, different constructors, check if any data have
been modified, support for IsNew and IsModified methods and stuff like that,
but they do not communicate with the database layer at all, only with other
entities.

I will problably add some validation logic as we go on, but I'm not done yet
;-)


TEK

Quote:
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:%23I3gu8xODHA.2284 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I don't know how big your project is, but for mine I'm really
considering
investing in an O/R tool because I'm not sure I have the time to deal
with
the issues involved with BEs. I'm not suggesting a tool will solve
them
all, but hopefully it'll cut down the amount of work I have to do.


It's an inhouse product. I have looked at some of the O/R tool
generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a clean
object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one of the OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in combination
with
base classes to auto generate the data-layer and business entities,
while
all the additional business logic will be handled by the business layer
(which is written manually).
The data layer will handle all saving and loading of objects, and will
also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation using
XML/Stylesheets saves me a lot of work, and at the same time I'm able to
get
the stuff the way I want it, not the way the person that created the
tool
though I wanted it.

Regards, TEK


ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business entities,
UserInfo
may
for example hold an collection of GroupInfo objects. (the groups a
user
is
member of).

So to the issue, with large listings (for example when calling
user.GetAllUsers()), you may only need/want the basic information,
not
the
connected info objects.
Normally, a logical way to solve this would be to implement layze
loading,
meaning that the users Group would not be filled until the calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a reference to
the
Business logic components, and wholia, a sircular reference.
At the same time that would lead to put business logic into the info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK











Reply With Quote
  #3  
Old   
Ice
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 06-26-2003 , 09:47 AM



Nice.
I would like to place "behavior" into my objects. However persistence would
be left outside. Could you give me an idea of how many tables/BEs you are
working with and a time estimate on what its taken you?

I'm trying to come up with budgets!

Thanks.
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote

Quote:
"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:Olqpf%23yODHA.3152 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Interesting mechanism your using here. So essentially you use metadata
to
generate your mappers and business entities?

Yes. The code to for example define a entity object with one single
property
in my xml file would be:
class name="MyObject" table="tdmyobject"
property name="Name" type="String" required="yes" dbcolum="name"
findbyone="yes" findbymany="yes"/
/class

This would (through a stylesheet) resolve to:
Info class name MyObjectInfo with:
- Get/set method (or getters/setters if you like that better ;-)
- Member variable
- Constructor requiering name as a property
- Mapping info (property values and table columns + table name)

A strong typed collection class named MyObjectInfoCollection

a DataLayer class with
- a CreateFromReader method that uses a SqlDataReader and the constructor
to
instanicate the info object
- a FindMyObjectByName() method
- a FindMyObjectsByName(criteria) method

There is also special support for properties referring to others Info
objects (are automatically loaded and instanciated by the datalayer) and
InfoCollections (also automatically loaded as well)

and lot more...
All generted classes is inherited from bases classes, so that it's easy to
add complex fetures without haveto autogenerate all of it...



Are you saying that your BEs don't have any logic in them?

No business logic, but they do have some logics:
Their are supporting IClone, different constructors, check if any data
have
been modified, support for IsNew and IsModified methods and stuff like
that,
but they do not communicate with the database layer at all, only with
other
entities.

I will problably add some validation logic as we go on, but I'm not done
yet
;-)


TEK

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:%23I3gu8xODHA.2284 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I don't know how big your project is, but for mine I'm really
considering
investing in an O/R tool because I'm not sure I have the time to
deal
with
the issues involved with BEs. I'm not suggesting a tool will solve
them
all, but hopefully it'll cut down the amount of work I have to do.


It's an inhouse product. I have looked at some of the O/R tool
generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a clean
object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one of the
OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in combination
with
base classes to auto generate the data-layer and business entities,
while
all the additional business logic will be handled by the business
layer
(which is written manually).
The data layer will handle all saving and loading of objects, and will
also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation using
XML/Stylesheets saves me a lot of work, and at the same time I'm able
to
get
the stuff the way I want it, not the way the person that created the
tool
though I wanted it.

Regards, TEK


ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business entities,
UserInfo
may
for example hold an collection of GroupInfo objects. (the groups a
user
is
member of).

So to the issue, with large listings (for example when calling
user.GetAllUsers()), you may only need/want the basic information,
not
the
connected info objects.
Normally, a logical way to solve this would be to implement layze
loading,
meaning that the users Group would not be filled until the calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a reference to
the
Business logic components, and wholia, a sircular reference.
At the same time that would lead to put business logic into the
info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK













Reply With Quote
  #4  
Old   
Ice
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 06-26-2003 , 10:26 AM



Don't know if you monitor the objectspaces newsgroup. I have a post about
OR mappers and I've had some interesting replies.
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote

Quote:
"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:Olqpf%23yODHA.3152 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Interesting mechanism your using here. So essentially you use metadata
to
generate your mappers and business entities?

Yes. The code to for example define a entity object with one single
property
in my xml file would be:
class name="MyObject" table="tdmyobject"
property name="Name" type="String" required="yes" dbcolum="name"
findbyone="yes" findbymany="yes"/
/class

This would (through a stylesheet) resolve to:
Info class name MyObjectInfo with:
- Get/set method (or getters/setters if you like that better ;-)
- Member variable
- Constructor requiering name as a property
- Mapping info (property values and table columns + table name)

A strong typed collection class named MyObjectInfoCollection

a DataLayer class with
- a CreateFromReader method that uses a SqlDataReader and the constructor
to
instanicate the info object
- a FindMyObjectByName() method
- a FindMyObjectsByName(criteria) method

There is also special support for properties referring to others Info
objects (are automatically loaded and instanciated by the datalayer) and
InfoCollections (also automatically loaded as well)

and lot more...
All generted classes is inherited from bases classes, so that it's easy to
add complex fetures without haveto autogenerate all of it...



Are you saying that your BEs don't have any logic in them?

No business logic, but they do have some logics:
Their are supporting IClone, different constructors, check if any data
have
been modified, support for IsNew and IsModified methods and stuff like
that,
but they do not communicate with the database layer at all, only with
other
entities.

I will problably add some validation logic as we go on, but I'm not done
yet
;-)


TEK

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:%23I3gu8xODHA.2284 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I don't know how big your project is, but for mine I'm really
considering
investing in an O/R tool because I'm not sure I have the time to
deal
with
the issues involved with BEs. I'm not suggesting a tool will solve
them
all, but hopefully it'll cut down the amount of work I have to do.


It's an inhouse product. I have looked at some of the O/R tool
generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a clean
object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one of the
OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in combination
with
base classes to auto generate the data-layer and business entities,
while
all the additional business logic will be handled by the business
layer
(which is written manually).
The data layer will handle all saving and loading of objects, and will
also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation using
XML/Stylesheets saves me a lot of work, and at the same time I'm able
to
get
the stuff the way I want it, not the way the person that created the
tool
though I wanted it.

Regards, TEK


ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business entities,
UserInfo
may
for example hold an collection of GroupInfo objects. (the groups a
user
is
member of).

So to the issue, with large listings (for example when calling
user.GetAllUsers()), you may only need/want the basic information,
not
the
connected info objects.
Normally, a logical way to solve this would be to implement layze
loading,
meaning that the users Group would not be filled until the calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a reference to
the
Business logic components, and wholia, a sircular reference.
At the same time that would lead to put business logic into the
info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK













Reply With Quote
  #5  
Old   
TEK
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 06-27-2003 , 10:13 AM



Hello Ice

Phu, took some time...
My harddrive (on a less than 1 month old laptop) went out the window.
I'm just back, have only installed 50% of the applications I need dough :-(

To your question about time, it's hard to tell.
We are currently having around 170 database tables.

We're working on doing a refactoring from a one/two layer application
written in VB6 (developed in cycles from 85) to a fully n-tiered .Net
application.

This means that we also will redesign the database (hopfully get a LOT less
than 170 tables).
We're currently in the design/evaluation/prototyping/testing stage to
evaluate the possibilities, so it's not possible to give any experience
number, as the app is not built yet.

Gathering information, testing methods and ideas and evaluate the business
logic is what's taking time. When I know how the classes should be created
(you first creates a small group of sample classes), it's done in a day or
two to create the stylesheets to autogenrate the classes...

regards, TEK

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:u33x3l#ODHA.2256 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
Nice.
I would like to place "behavior" into my objects. However persistence
would
be left outside. Could you give me an idea of how many tables/BEs you are
working with and a time estimate on what its taken you?

I'm trying to come up with budgets!

Thanks.
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:OvUT%2346ODHA.2788 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:Olqpf%23yODHA.3152 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Interesting mechanism your using here. So essentially you use
metadata
to
generate your mappers and business entities?

Yes. The code to for example define a entity object with one single
property
in my xml file would be:
class name="MyObject" table="tdmyobject"
property name="Name" type="String" required="yes" dbcolum="name"
findbyone="yes" findbymany="yes"/
/class

This would (through a stylesheet) resolve to:
Info class name MyObjectInfo with:
- Get/set method (or getters/setters if you like that better ;-)
- Member variable
- Constructor requiering name as a property
- Mapping info (property values and table columns + table name)

A strong typed collection class named MyObjectInfoCollection

a DataLayer class with
- a CreateFromReader method that uses a SqlDataReader and the
constructor
to
instanicate the info object
- a FindMyObjectByName() method
- a FindMyObjectsByName(criteria) method

There is also special support for properties referring to others Info
objects (are automatically loaded and instanciated by the datalayer) and
InfoCollections (also automatically loaded as well)

and lot more...
All generted classes is inherited from bases classes, so that it's easy
to
add complex fetures without haveto autogenerate all of it...



Are you saying that your BEs don't have any logic in them?

No business logic, but they do have some logics:
Their are supporting IClone, different constructors, check if any data
have
been modified, support for IsNew and IsModified methods and stuff like
that,
but they do not communicate with the database layer at all, only with
other
entities.

I will problably add some validation logic as we go on, but I'm not done
yet
;-)


TEK

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:%23I3gu8xODHA.2284 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I don't know how big your project is, but for mine I'm really
considering
investing in an O/R tool because I'm not sure I have the time to
deal
with
the issues involved with BEs. I'm not suggesting a tool will
solve
them
all, but hopefully it'll cut down the amount of work I have to do.


It's an inhouse product. I have looked at some of the O/R tool
generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a clean
object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one of the
OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in
combination
with
base classes to auto generate the data-layer and business entities,
while
all the additional business logic will be handled by the business
layer
(which is written manually).
The data layer will handle all saving and loading of objects, and
will
also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation using
XML/Stylesheets saves me a lot of work, and at the same time I'm
able
to
get
the stuff the way I want it, not the way the person that created the
tool
though I wanted it.

Regards, TEK


ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business entities,
UserInfo
may
for example hold an collection of GroupInfo objects. (the groups
a
user
is
member of).

So to the issue, with large listings (for example when calling
user.GetAllUsers()), you may only need/want the basic
information,
not
the
connected info objects.
Normally, a logical way to solve this would be to implement
layze
loading,
meaning that the users Group would not be filled until the
calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a reference
to
the
Business logic components, and wholia, a sircular reference.
At the same time that would lead to put business logic into the
info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK















Reply With Quote
  #6  
Old   
TEK
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 06-27-2003 , 11:14 AM



Hei

I did not monitor the objectspaces group, I have read up on the thread.
I think the question about bying a tool or not is a bit more complext than
what it seems like there.

In my case I'm in a controlled envoirment and working against a database
that I'm able to controll the structure of.
This gives me the possibility to expect a lot of "stuff" (for example that
all my tables is having one single guid as the primary key).
This makes the demand for creating a limited class generator A LOT smaller
than for creating a general tool.
My "library" may also add a lot of logic just based on naming. (for example,
I know that all objects ending with "Info" is info object and should, if
included in one object, be fetched from another data logic object, and the
code generator may act upon this).

At the same time, special issues may be easy resolved using shortcuts or
just manually write the special classes.

But I would not have tried writing my own general mapper application ;-)

You will probably find as many opinions on this as you find develpers.
In my eyes, in my current situation, and with my current task to do, I do
not think using a tool is the right way to go...

regards, TEK

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:#9HAz7#ODHA.1612 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
Don't know if you monitor the objectspaces newsgroup. I have a post about
OR mappers and I've had some interesting replies.
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:OvUT%2346ODHA.2788 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:Olqpf%23yODHA.3152 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Interesting mechanism your using here. So essentially you use
metadata
to
generate your mappers and business entities?

Yes. The code to for example define a entity object with one single
property
in my xml file would be:
class name="MyObject" table="tdmyobject"
property name="Name" type="String" required="yes" dbcolum="name"
findbyone="yes" findbymany="yes"/
/class

This would (through a stylesheet) resolve to:
Info class name MyObjectInfo with:
- Get/set method (or getters/setters if you like that better ;-)
- Member variable
- Constructor requiering name as a property
- Mapping info (property values and table columns + table name)

A strong typed collection class named MyObjectInfoCollection

a DataLayer class with
- a CreateFromReader method that uses a SqlDataReader and the
constructor
to
instanicate the info object
- a FindMyObjectByName() method
- a FindMyObjectsByName(criteria) method

There is also special support for properties referring to others Info
objects (are automatically loaded and instanciated by the datalayer) and
InfoCollections (also automatically loaded as well)

and lot more...
All generted classes is inherited from bases classes, so that it's easy
to
add complex fetures without haveto autogenerate all of it...



Are you saying that your BEs don't have any logic in them?

No business logic, but they do have some logics:
Their are supporting IClone, different constructors, check if any data
have
been modified, support for IsNew and IsModified methods and stuff like
that,
but they do not communicate with the database layer at all, only with
other
entities.

I will problably add some validation logic as we go on, but I'm not done
yet
;-)


TEK

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:%23I3gu8xODHA.2284 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I don't know how big your project is, but for mine I'm really
considering
investing in an O/R tool because I'm not sure I have the time to
deal
with
the issues involved with BEs. I'm not suggesting a tool will
solve
them
all, but hopefully it'll cut down the amount of work I have to do.


It's an inhouse product. I have looked at some of the O/R tool
generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a clean
object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one of the
OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in
combination
with
base classes to auto generate the data-layer and business entities,
while
all the additional business logic will be handled by the business
layer
(which is written manually).
The data layer will handle all saving and loading of objects, and
will
also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation using
XML/Stylesheets saves me a lot of work, and at the same time I'm
able
to
get
the stuff the way I want it, not the way the person that created the
tool
though I wanted it.

Regards, TEK


ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business entities,
UserInfo
may
for example hold an collection of GroupInfo objects. (the groups
a
user
is
member of).

So to the issue, with large listings (for example when calling
user.GetAllUsers()), you may only need/want the basic
information,
not
the
connected info objects.
Normally, a logical way to solve this would be to implement
layze
loading,
meaning that the users Group would not be filled until the
calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a reference
to
the
Business logic components, and wholia, a sircular reference.
At the same time that would lead to put business logic into the
info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK















Reply With Quote
  #7  
Old   
TEK
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 06-29-2003 , 03:58 AM



Just one final general comment about generators...

I do NOT like generators where the base classes is dependent upon a foreign
assembly that I do not have the code to.
In my view, having the very hart of my application beeing built upon a
library that I do not have the source code to, neither the possibility to
directly fix bug in, is not a good situation.

Because of this, I think that generators should only produce standalone
code, not code based upon a company owned assembly.
(Expect when it's my own of course ;-)

There is of corse degrees of this, I'm at the end using the .Net framework,
but it's a bit different in the number of users, company stability/size and
so on.
With a "small" company, there is a very much lager problability that the
product will change or stop existing, leaving you in the dark.

With for example GUI components, it's easier to take action for such cases.
But again, if your layers are good written, it might not be that difficult
anyway ;-)

regards, TEK

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:eev07ONPDHA.1216 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
Interesting take....
Not sure what I'll do, but I have some developers doing some intial stuff
now, so we'll see where it goes

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:epLNs7LPDHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hei

I did not monitor the objectspaces group, I have read up on the thread.
I think the question about bying a tool or not is a bit more complext
than
what it seems like there.

In my case I'm in a controlled envoirment and working against a database
that I'm able to controll the structure of.
This gives me the possibility to expect a lot of "stuff" (for example
that
all my tables is having one single guid as the primary key).
This makes the demand for creating a limited class generator A LOT
smaller
than for creating a general tool.
My "library" may also add a lot of logic just based on naming. (for
example,
I know that all objects ending with "Info" is info object and should, if
included in one object, be fetched from another data logic object, and
the
code generator may act upon this).

At the same time, special issues may be easy resolved using shortcuts or
just manually write the special classes.

But I would not have tried writing my own general mapper application ;-)

You will probably find as many opinions on this as you find develpers.
In my eyes, in my current situation, and with my current task to do, I
do
not think using a tool is the right way to go...

regards, TEK

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:#9HAz7#ODHA.1612 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Don't know if you monitor the objectspaces newsgroup. I have a post
about
OR mappers and I've had some interesting replies.
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:OvUT%2346ODHA.2788 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:Olqpf%23yODHA.3152 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Interesting mechanism your using here. So essentially you use
metadata
to
generate your mappers and business entities?

Yes. The code to for example define a entity object with one single
property
in my xml file would be:
class name="MyObject" table="tdmyobject"
property name="Name" type="String" required="yes" dbcolum="name"
findbyone="yes" findbymany="yes"/
/class

This would (through a stylesheet) resolve to:
Info class name MyObjectInfo with:
- Get/set method (or getters/setters if you like that better ;-)
- Member variable
- Constructor requiering name as a property
- Mapping info (property values and table columns + table name)

A strong typed collection class named MyObjectInfoCollection

a DataLayer class with
- a CreateFromReader method that uses a SqlDataReader and the
constructor
to
instanicate the info object
- a FindMyObjectByName() method
- a FindMyObjectsByName(criteria) method

There is also special support for properties referring to others
Info
objects (are automatically loaded and instanciated by the datalayer)
and
InfoCollections (also automatically loaded as well)

and lot more...
All generted classes is inherited from bases classes, so that it's
easy
to
add complex fetures without haveto autogenerate all of it...



Are you saying that your BEs don't have any logic in them?

No business logic, but they do have some logics:
Their are supporting IClone, different constructors, check if any
data
have
been modified, support for IsNew and IsModified methods and stuff
like
that,
but they do not communicate with the database layer at all, only
with
other
entities.

I will problably add some validation logic as we go on, but I'm not
done
yet
;-)


TEK

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:%23I3gu8xODHA.2284 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I don't know how big your project is, but for mine I'm really
considering
investing in an O/R tool because I'm not sure I have the time
to
deal
with
the issues involved with BEs. I'm not suggesting a tool will
solve
them
all, but hopefully it'll cut down the amount of work I have to
do.


It's an inhouse product. I have looked at some of the O/R tool
generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a
clean
object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one of
the
OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in
combination
with
base classes to auto generate the data-layer and business
entities,
while
all the additional business logic will be handled by the
business
layer
(which is written manually).
The data layer will handle all saving and loading of objects,
and
will
also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation using
XML/Stylesheets saves me a lot of work, and at the same time I'm
able
to
get
the stuff the way I want it, not the way the person that created
the
tool
though I wanted it.

Regards, TEK


ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business
logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business
entities,
UserInfo
may
for example hold an collection of GroupInfo objects. (the
groups
a
user
is
member of).

So to the issue, with large listings (for example when
calling
user.GetAllUsers()), you may only need/want the basic
information,
not
the
connected info objects.
Normally, a logical way to solve this would be to implement
layze
loading,
meaning that the users Group would not be filled until the
calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a
reference
to
the
Business logic components, and wholia, a sircular reference.
At the same time that would lead to put business logic into
the
info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK



















Reply With Quote
  #8  
Old   
Ice
 
Posts: n/a

Default Re: Input needed, using lazy load with business entities - 07-03-2003 , 09:35 AM



Understood.

Let me know how much progress you make building it by hand. I will contend
that the focus of your work should be implementing functionality and not
plugging components. How you do this is obviously up to anyone.

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote

Quote:
Just one final general comment about generators...

I do NOT like generators where the base classes is dependent upon a
foreign
assembly that I do not have the code to.
In my view, having the very hart of my application beeing built upon a
library that I do not have the source code to, neither the possibility to
directly fix bug in, is not a good situation.

Because of this, I think that generators should only produce standalone
code, not code based upon a company owned assembly.
(Expect when it's my own of course ;-)

There is of corse degrees of this, I'm at the end using the .Net
framework,
but it's a bit different in the number of users, company stability/size
and
so on.
With a "small" company, there is a very much lager problability that the
product will change or stop existing, leaving you in the dark.

With for example GUI components, it's easier to take action for such
cases.
But again, if your layers are good written, it might not be that difficult
anyway ;-)

regards, TEK

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:eev07ONPDHA.1216 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Interesting take....
Not sure what I'll do, but I have some developers doing some intial
stuff
now, so we'll see where it goes

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:epLNs7LPDHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hei

I did not monitor the objectspaces group, I have read up on the
thread.
I think the question about bying a tool or not is a bit more complext
than
what it seems like there.

In my case I'm in a controlled envoirment and working against a
database
that I'm able to controll the structure of.
This gives me the possibility to expect a lot of "stuff" (for example
that
all my tables is having one single guid as the primary key).
This makes the demand for creating a limited class generator A LOT
smaller
than for creating a general tool.
My "library" may also add a lot of logic just based on naming. (for
example,
I know that all objects ending with "Info" is info object and should,
if
included in one object, be fetched from another data logic object, and
the
code generator may act upon this).

At the same time, special issues may be easy resolved using shortcuts
or
just manually write the special classes.

But I would not have tried writing my own general mapper application
;-)

You will probably find as many opinions on this as you find develpers.
In my eyes, in my current situation, and with my current task to do, I
do
not think using a tool is the right way to go...

regards, TEK

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:#9HAz7#ODHA.1612 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Don't know if you monitor the objectspaces newsgroup. I have a post
about
OR mappers and I've had some interesting replies.
ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:OvUT%2346ODHA.2788 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:Olqpf%23yODHA.3152 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Interesting mechanism your using here. So essentially you use
metadata
to
generate your mappers and business entities?

Yes. The code to for example define a entity object with one
single
property
in my xml file would be:
class name="MyObject" table="tdmyobject"
property name="Name" type="String" required="yes"
dbcolum="name"
findbyone="yes" findbymany="yes"/
/class

This would (through a stylesheet) resolve to:
Info class name MyObjectInfo with:
- Get/set method (or getters/setters if you like that better ;-)
- Member variable
- Constructor requiering name as a property
- Mapping info (property values and table columns + table name)

A strong typed collection class named MyObjectInfoCollection

a DataLayer class with
- a CreateFromReader method that uses a SqlDataReader and the
constructor
to
instanicate the info object
- a FindMyObjectByName() method
- a FindMyObjectsByName(criteria) method

There is also special support for properties referring to others
Info
objects (are automatically loaded and instanciated by the
datalayer)
and
InfoCollections (also automatically loaded as well)

and lot more...
All generted classes is inherited from bases classes, so that it's
easy
to
add complex fetures without haveto autogenerate all of it...



Are you saying that your BEs don't have any logic in them?

No business logic, but they do have some logics:
Their are supporting IClone, different constructors, check if any
data
have
been modified, support for IsNew and IsModified methods and stuff
like
that,
but they do not communicate with the database layer at all, only
with
other
entities.

I will problably add some validation logic as we go on, but I'm
not
done
yet
;-)


TEK

ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:%23I3gu8xODHA.2284 (AT) TK2MSFTNGP11 (DOT) phx.gbl...

"Ice" <ice (AT) nospam (DOT) com> skrev i melding
news:OYkahoxODHA.3016 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I don't know how big your project is, but for mine I'm
really
considering
investing in an O/R tool because I'm not sure I have the
time
to
deal
with
the issues involved with BEs. I'm not suggesting a tool
will
solve
them
all, but hopefully it'll cut down the amount of work I have
to
do.


It's an inhouse product. I have looked at some of the O/R tool
generators,
but I did not find anyone that suited my needs.
Also, it seems like most of these tools is targeted against a
clean
object
model that's kind of forcing the usage of thick clients...
(More suited for a two layer application, GUI/data layer)
However, If I had a small project to do in a hurry, using one
of
the
OR
tools I have looked into would have worked great.

I'm going for a combination. I'm using XML/Stylesheets in
combination
with
base classes to auto generate the data-layer and business
entities,
while
all the additional business logic will be handled by the
business
layer
(which is written manually).
The data layer will handle all saving and loading of objects,
and
will
also
publish methods as GetOne, GetAll, FindByName and so on...

The combination of a good object model and auto generation
using
XML/Stylesheets saves me a lot of work, and at the same time
I'm
able
to
get
the stuff the way I want it, not the way the person that
created
the
tool
though I wanted it.

Regards, TEK


ice
"TEK" <trondeirikkolloen (AT) hotmail (DOT) com> wrote in message
news:eU7Qs9uODHA.1072 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hello

I could need some input on this issue.
All ideas would us received with thanks...

Application structure:
- Thin client (currently an windows app)
- Business layer
Business Entity components
Business logic components
- Data layer

The Business Entity components is created by the Business
logic
components.
typically usage:
User user = new User();
UserInfo myself = user.GetUserByName("tek");
// do stuff with myself ;-)
user.SaveUser(myself);

The Business Entities may also contain other business
entities,
UserInfo
may
for example hold an collection of GroupInfo objects. (the
groups
a
user
is
member of).

So to the issue, with large listings (for example when
calling
user.GetAllUsers()), you may only need/want the basic
information,
not
the
connected info objects.
Normally, a logical way to solve this would be to
implement
layze
loading,
meaning that the users Group would not be filled until the
calling
method
actually called:
GroupInfoCollection groups = myself.Groups();

But to do that, the entity layer would have to have a
reference
to
the
Business logic components, and wholia, a sircular
reference.
At the same time that would lead to put business logic
into
the
info
objects, which I'm not to keen on.

Any good ideas out there?

Best reagards, TEK





















Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.