3tier app in vs 2005
-
I am trying to write a layered app in vb 2005 .NET I think on a 2 physical levels/tiers: host with a DB, and client (desktop), both not interconnected (except for internet) Host: will contain the DB (SQLServer) , the Data Access Layer DAL, and a Web Service layer, WS_CH desktop, will contain the application (winforms), and Business Logic layer BLL. The BLL will call the (remote) WS_CH, this will call the DAL and this will attack the DB. OK. I will use a Data Transfer Object DTO to pass data up and down all the stream, from the UI to the DB and back. This DTO can be an untyped dataset, in which case all the assemblies involved (in fact, all I mentioned) will contain a reference to System.Data. But.... what if I want the DTO to be a custom class, living in a independent assembly, and possibly hosted in the client. How will the host receive and handle a reference to that (remote) object. Have I to place the DTO in the host (because from the client I know the URL and then I can reference it)?. If not, i suspect I have to use remoting technology, or activator, or reflection, or the new WCF in 3.0,... but I cannot find my way to that..... Any hint, please? thx
-
I am trying to write a layered app in vb 2005 .NET I think on a 2 physical levels/tiers: host with a DB, and client (desktop), both not interconnected (except for internet) Host: will contain the DB (SQLServer) , the Data Access Layer DAL, and a Web Service layer, WS_CH desktop, will contain the application (winforms), and Business Logic layer BLL. The BLL will call the (remote) WS_CH, this will call the DAL and this will attack the DB. OK. I will use a Data Transfer Object DTO to pass data up and down all the stream, from the UI to the DB and back. This DTO can be an untyped dataset, in which case all the assemblies involved (in fact, all I mentioned) will contain a reference to System.Data. But.... what if I want the DTO to be a custom class, living in a independent assembly, and possibly hosted in the client. How will the host receive and handle a reference to that (remote) object. Have I to place the DTO in the host (because from the client I know the URL and then I can reference it)?. If not, i suspect I have to use remoting technology, or activator, or reflection, or the new WCF in 3.0,... but I cannot find my way to that..... Any hint, please? thx
-
thx, that thread deals on dataset versus other structures as Data Transfer Objects, and this is OK, but if the DAL in a remote host has to deal, say, with a typed dataset or a custom class or custom collection defined in the desktop (in an assembly who seats in a desktop, I mean), how can the DAL (in the host) get a reference to that????
-
thx, that thread deals on dataset versus other structures as Data Transfer Objects, and this is OK, but if the DAL in a remote host has to deal, say, with a typed dataset or a custom class or custom collection defined in the desktop (in an assembly who seats in a desktop, I mean), how can the DAL (in the host) get a reference to that????
Actually, the thread deals with defining the structure of the class in the datalayer (I know because I wrote that thread as well). Once the structure is defined in the DAL, then it can be made available across all the tiers. So, the DAL can populate the collection, and new entries can be added in the business layer and saved back via the DAL. So, if you reverse your thinking, you start with the entity in the DAL and then this gets exposed to the business layer (and on into the presentation layer). The beauty about this approach is that you remove the need to reference things such as System.Data in the front end, and as I stated in that thread you can expose this to other programming environments as well.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before. -
Actually, the thread deals with defining the structure of the class in the datalayer (I know because I wrote that thread as well). Once the structure is defined in the DAL, then it can be made available across all the tiers. So, the DAL can populate the collection, and new entries can be added in the business layer and saved back via the DAL. So, if you reverse your thinking, you start with the entity in the DAL and then this gets exposed to the business layer (and on into the presentation layer). The beauty about this approach is that you remove the need to reference things such as System.Data in the front end, and as I stated in that thread you can expose this to other programming environments as well.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before. -
thx, letting the DTO live in the host, together with the DAL "it gets exposed to the BL and presentation layer"... but, how, if DAL/DTO and BL/PL are in different computers, only visible through internet? thx
If you are using a webservice, the definition of the class (well a proxy version), will be added to the business layer when you add in a web-reference. This means that you can pass this back and forwards without worrying about it.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before. -
I am trying to write a layered app in vb 2005 .NET I think on a 2 physical levels/tiers: host with a DB, and client (desktop), both not interconnected (except for internet) Host: will contain the DB (SQLServer) , the Data Access Layer DAL, and a Web Service layer, WS_CH desktop, will contain the application (winforms), and Business Logic layer BLL. The BLL will call the (remote) WS_CH, this will call the DAL and this will attack the DB. OK. I will use a Data Transfer Object DTO to pass data up and down all the stream, from the UI to the DB and back. This DTO can be an untyped dataset, in which case all the assemblies involved (in fact, all I mentioned) will contain a reference to System.Data. But.... what if I want the DTO to be a custom class, living in a independent assembly, and possibly hosted in the client. How will the host receive and handle a reference to that (remote) object. Have I to place the DTO in the host (because from the client I know the URL and then I can reference it)?. If not, i suspect I have to use remoting technology, or activator, or reflection, or the new WCF in 3.0,... but I cannot find my way to that..... Any hint, please? thx
Hiya, Not sure if you're still looking at this, but I came across a similiar problem where in the BLL and UI layers I had my own data objects that were hosted in the client or a webservice. Communication from the BLL to the DAL is remoting. I didn't want the DAL to have any knowledge of these objects because these objects were "plugins" and the DAL could not possibly be able to reference the objects. What I did was implement functionality to disassemble custom classes (in the BLL tier) into a generic object which was then passed into the DAL. All my custom classes inherit from a general object providing methods and properties to extract the data from the custom class, which helped disassemble the data. Hope this helps Cheers, Ty
-
Hiya, Not sure if you're still looking at this, but I came across a similiar problem where in the BLL and UI layers I had my own data objects that were hosted in the client or a webservice. Communication from the BLL to the DAL is remoting. I didn't want the DAL to have any knowledge of these objects because these objects were "plugins" and the DAL could not possibly be able to reference the objects. What I did was implement functionality to disassemble custom classes (in the BLL tier) into a generic object which was then passed into the DAL. All my custom classes inherit from a general object providing methods and properties to extract the data from the custom class, which helped disassemble the data. Hope this helps Cheers, Ty