Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2007

Tip: Looking for answers? Try searching our database.

Design of data classes that are shared between Web Services and Ap

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
madcowJack - 20 Dec 2007 18:21 GMT
Does anyone know of Best Practices for the design of data classes which are
read and written from and to the server ? We have a number of web apps that
have similar needs and we want to build common data classes that represent
the different scenarios.
                Specifically for one application we need a 'view' on a
holders policy and in another circumstance we might only be interested in the
'billing' info related to that policy. We want a common object which both the
web service and web apps will build with. That way we only maintain the code
in one place etc..

I suppose my question is really what do other people use to design data
classes and the namespaces associated with them ?
Tiago Halm - 20 Dec 2007 22:33 GMT
I hope I'm reading your scenario correctly ... so let me give you my
approach.

I normally design a DAL (Data Access Layer) to access the database. I also
design a BAL (Business Access Layer) which basically reflects the expected
business scenario. Afterwards, this same BAL (an object object oriented
model), can be exposed in several ways, where 2 of the most common are:

** WebApps
In this case, and for GridView (as an example) I design a simple object
without behavior to simply be used as an object data source for the
GridView. This simple object is the one that knows how to bridge the BAL to
itself. Basically, its not the BAL that is used directly in the ASP.NET
controls, but an object which may be different according to the visual needs

** WebServices
Again, in this case I design a simple object (DataContract) without behavior
to simply be used as a flat structure for SOAP exposure. This simple
structure, again, is the one that knows how to bridge the BAL to itself. And
again, its not the BAL that is used directly in SOAP (WCF, WSDL), but an
object which may be different according to the SOAP needs.

To conclude, its the BAL that is shared. Each kind of exposure (which may be
designed by other teams) is responsible for using the BAL indirectly to
expose the required data performing any transformations it feels required
(example: via WebApp a BAL numeric value is exposed with currency format,
via WebService is exposed with numeric format and another property with the
currency type).

Hope it helps,
Tiago Halm

> Does anyone know of Best Practices for the design of data classes which
> are
[quoted text clipped - 13 lines]
> I suppose my question is really what do other people use to design data
> classes and the namespaces associated with them ?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.