Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing a site and we are using REST architecture.

There are business objects that needs to be shared between the client and the server.

I am very particular about Object Oriented code. So my business objects have methods defined in it.

Example, I have a Employee object. I am sharing this with client.

When the client calls Employee.getData(), the method will talk to the REST Service and returns me the data.

At the same time when the server calls Employee.getData(), the method will talk to the database and return the data.

Can somebody please throw some light on how to implement this without using extension methods.

Is there any design pattern that works best in this case?

Girish
Posted
Updated 13-Dec-11 0:19am
v2

1 solution

Well, this is really not how REST services are consumed in Client Application. REST service call is a pure HTTP call which returns Data in a XML/JSON format.

Have a look at below links for information on "REST".

http://en.wikipedia.org/wiki/Representational_state_transfer

http://msdn.microsoft.com/en-us/library/dd203052.aspx

http://msdn.microsoft.com/en-us/netframework/cc950529

You may use Multi-Tier architecture for your Business Logic and Data-Access code.

Three Layer Architecture in C# .NET

Selection of Design Pattern totally depends on your business requirements, I will suggest you just make sure you are following fundamentals of Object Oriented Programming properly.

Introduction to Object Oriented Programming Concepts (OOP) and More
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900