This is a migrated thread and some comments may be shown as answers.

ORM with Web Client Software Factory

1 Answer 44 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sarulatha Selvan
Top achievements
Rank 1
Sarulatha Selvan asked on 28 Nov 2010, 11:36 AM
HI--
Ours is a Web application utilizing the Web Client Software factory patterns and practices from Microsoft.
This involves data objects to be transported across multiple layers.
UI layer View and presenter
BUsiness module layer
Data access layer

All our ORM transactions are carried out at the data access layer. I would like you to provide suggesstion on how to implement a best posible solution.. Find below our curent approach

WE create the Objectscope in the DAL for the first time and keep it open.Assume i would like to list products in Radgrid and perform add and edit on it.

Step 1-- Using the objectscope i would get the list of products like objectscope.extent<Product> and use ToList to convert to List<Product>
This list is transported all the way to UI and assigned to the grid datasource

Step 2--User selects a record in the grid and performs edit..we use Popup edit form so the dataitem is transferred to the edit form and i store the same to viewstate.NOw the user edits the data and click the save button the object is again transfeered back all the way to DAL to update it.Where in again in DAL i retrieve the same record and copy the values from the object whihc i transferred from UI layer within a scope.transaction.

My question does the product object is still persistent when i retrieve from the radgrid item command dataitem or it is just a transient item. I guess it is transient as iam not opening any transaction to edit its values in the UI.Need to know once the data is loaded to grs the object becomes non persistent or still it is persistent.

also in certin situation we would be using asp.net wizard as a popu edit control by storing the dataitem in session and tranferring across pages.

please let us know your comments on our aproach or suggest best possible solution.Since we are using diffent layers would the maser page or the httpcontext would wok for us?

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 30 Nov 2010, 10:30 AM
Hi Sarulatha Selvan,

 I would not suggest you to put the OpenAccess persistent objects into the View or Session state as they are not serializable and your projects will not work with such architecture on a web farm. This also prevents them from being sent over the wire in a web service scenario. I suggest you to use transporting objects that reflect the OpenAccess persistent objects for those purposes in the upper layers. Please have a look into the following sample application which shows the suggested practices for N-Tier development

As for the scope handling approach, I would suggest you to use the HttpContext one as that is something you can handle in lower layers unlike the Master Page which is the UI Layer.

Kind regards,
Zoran
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Development (API, general questions)
Asked by
Sarulatha Selvan
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or