![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
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. |
|
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 |
#2
| |||
| |||
|
|
Interesting mechanism your using here. So essentially you use metadata to generate your mappers and business entities? |
|
Are you saying that your BEs don't have any logic in them? |
|
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 |
#3
| |||
| |||
|
|
"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 |
#4
| |||
| |||
|
|
"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 |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
#8
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |