Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Design of data classes that are shared between Web Services and Ap

Reply
Thread Tools

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

 
 
madcowJack
Guest
Posts: n/a
 
      12-20-2007
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 ?
 
Reply With Quote
 
 
 
 
Tiago Halm
Guest
Posts: n/a
 
      12-20-2007
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

"madcowJack" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 ?



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Web design services | website designing | hire a website designer |creative web design sravan kumar Python 0 06-21-2011 12:23 PM
Instantiating classes / sharing data between classes Trevoke Ruby 10 07-22-2009 09:21 PM
What is the difference between C# windows Services and web services in vs.net? Nick ASP .Net 1 09-12-2005 02:33 PM
linked list that is shared between many classes? james C++ 3 02-07-2004 12:41 AM



Advertisments