|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to use typed datasets in 3-tier environmentWhat is the proper way of working with typed datasets in a 3-tier
environment? Should I use a common assembly for the typed datasets that can be referenced in the presentation layer, business logic layer and the data access layer? I really don't want to add a reference to my data access layer in my presentation layer. All help (links to articles, code snippets, ...) is welcome TIA Gabriel Lozano-Morán I usually put the typed dataset objects within the businese logic layer,
Presentation layer has a reference to businese logic layer, thus "knows" all the available typed dataset objects. Businese logic layer contains a reference to data access layer, using it to fill the typed dataset objects and perform businese rules on them. Presentation layer does not need or should know about the data access layer. Data access layer should not or need to know anything about the typed dataset objects. You can also have a separate assembly containing all your typed dataset objects, and reference it in both the presentation and businese layers. david Show quoteHide quote "Gabriel Lozano-Morán" <gabriel.loz***@the-ecorp.com> wrote in message news:ONU%23t9qOFHA.524@TK2MSFTNGP09.phx.gbl... > What is the proper way of working with typed datasets in a 3-tier > environment? Should I use a common assembly for the typed datasets that can > be referenced in the presentation layer, business logic layer and the data > access layer? I really don't want to add a reference to my data access layer > in my presentation layer. > > All help (links to articles, code snippets, ...) is welcome > > TIA > > Gabriel Lozano-Morán > > Hello David
I think I will go for the common assembly approach by creating a seperate assembly containing nothing but the typed datasets. In your reply you said that you use the data access layer to fill the typed dataset objects. I have added a component class to my data access layer and I can drag and drop tables from my database and to have the SqlDataAdapters automatically generated but these SqlDataAdapters are private within the component. Is there a better approach? TIA Gabriel Lozano-Morán Show quoteHide quote "David Lei" <wei328@online.nospam> wrote in message news:OGGoXKrOFHA.1732@TK2MSFTNGP14.phx.gbl... >I usually put the typed dataset objects within the businese logic layer, > Presentation layer has a reference to businese logic layer, thus "knows" > all > the available typed dataset objects. > > Businese logic layer contains a reference to data access layer, using it > to > fill the typed dataset objects and perform businese rules on them. > > Presentation layer does not need or should know about the data access > layer. > Data access layer should not or need to know anything about the typed > dataset objects. > > You can also have a separate assembly containing all your typed dataset > objects, > and reference it in both the presentation and businese layers. > > david > > > "Gabriel Lozano-Morán" <gabriel.loz***@the-ecorp.com> wrote in message > news:ONU%23t9qOFHA.524@TK2MSFTNGP09.phx.gbl... >> What is the proper way of working with typed datasets in a 3-tier >> environment? Should I use a common assembly for the typed datasets that > can >> be referenced in the presentation layer, business logic layer and the >> data >> access layer? I really don't want to add a reference to my data access > layer >> in my presentation layer. >> >> All help (links to articles, code snippets, ...) is welcome >> >> TIA >> >> Gabriel Lozano-Morán >> >> > > I normally code everything manually so it's very easy to create a
Data Access class and passing typed dataset to it. The typed DataSet objects don't need to know anything about the SqlDataAdapter, they are being pass into the Data Access layer and the DAL will do the rest, insert, update and delete. Check out the MSDN written Data Access Layer class, You can download it and use it on your project. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/daab.asp There maybe some way you can do the same in a VS designer/drag and drop fashion. but I'm not familiar with it, coding everything manually has more flexibilities. 3-tier design is mainly for enterprise level application. If you don't need it, you don't have to use it. david Show quoteHide quote "Gabriel Lozano-Morán" <gabriel.loz***@the-ecorp.com> wrote in message news:%23A7ncwrOFHA.3156@TK2MSFTNGP15.phx.gbl... > Hello David > > I think I will go for the common assembly approach by creating a seperate > assembly containing nothing but the typed datasets. > > In your reply you said that you use the data access layer to fill the typed > dataset objects. I have added a component class to my data access layer and > I can drag and drop tables from my database and to have the SqlDataAdapters > automatically generated but these SqlDataAdapters are private within the > component. Is there a better approach? > > TIA > > Gabriel Lozano-Morán > > "David Lei" <wei328@online.nospam> wrote in message > news:OGGoXKrOFHA.1732@TK2MSFTNGP14.phx.gbl... > >I usually put the typed dataset objects within the businese logic layer, > > Presentation layer has a reference to businese logic layer, thus "knows" > > all > > the available typed dataset objects. > > > > Businese logic layer contains a reference to data access layer, using it > > to > > fill the typed dataset objects and perform businese rules on them. > > > > Presentation layer does not need or should know about the data access > > layer. > > Data access layer should not or need to know anything about the typed > > dataset objects. > > > > You can also have a separate assembly containing all your typed dataset > > objects, > > and reference it in both the presentation and businese layers. > > > > david > > > > > > "Gabriel Lozano-Morán" <gabriel.loz***@the-ecorp.com> wrote in message > > news:ONU%23t9qOFHA.524@TK2MSFTNGP09.phx.gbl... > >> What is the proper way of working with typed datasets in a 3-tier > >> environment? Should I use a common assembly for the typed datasets that > > can > >> be referenced in the presentation layer, business logic layer and the > >> data > >> access layer? I really don't want to add a reference to my data access > > layer > >> in my presentation layer. > >> > >> All help (links to articles, code snippets, ...) is welcome > >> > >> TIA > >> > >> Gabriel Lozano-Morán > >> > >> > > > > > >
Other interesting topics
Size of datatable...in bytes?
SQL Server does not exist Join two datatables populated from different sources? memory leak in SqlDataAdapter.Fill method? ADO.Net Connection Pooling Problem with Oracle DataView.RowFilter issue Formatting a SQL query ConnectionTimeout is always 15 coming back from the DataLinksClass dialog Sending XML From .Net To SQLServer ANN: Microsoft webcast on DataSets |
|||||||||||||||||||||||