Print Page | Close Window

Save interception for server side business logic

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3094
Printed Date: 13-May-2026 at 1:58pm


Topic: Save interception for server side business logic
Posted By: nazbrok
Subject: Save interception for server side business logic
Date Posted: 15-Nov-2011 at 1:01am
Hi,

I want to intercept a save on the server to perfom some task BEFORE the save.
For exemple : in the SL client, I created a customer but when I save it I want to create many other entities which are not known in the client (because there is no need to bring all this complexity to the client).

I wanted to use the EntityServerSaveInterceptor but the doc say to not put this kind of stuff in it. Also, it will be a big application (maybe 200 entities+) I can't imagine having all our server side logic in ONE class only.

I did read the guidline (http://drc.ideablade.com/xwiki/bin/view/Documentation/save-lifecycle-server) but it didn't really helped me out.
What is the best way to do it ?

regards



Replies:
Posted By: DenisK
Date Posted: 15-Nov-2011 at 12:38pm
Hi nazbrok;

You don't have to put all the server side logic in the EntityServerSaveInterceptor class. 

For example, in this particular use case, you can create a separate utility class with a utility method that will create the "many other entities" that you require before saving.

And then, in the ExecuteSave override, you can call this utility method to create those other entities and then call base.ExecuteSave().

My point is that you can separate the logic in a separate class but you have to call the logic within the EntityServerSaveInterceptor class.

We also provide RPC (Remote Procedure Call), also called RSMC, (Remote Server Method Call) to handle other server side scenarios.  http://drc.ideablade.com/xwiki/bin/view/Documentation/rsmc-query - http://drc.ideablade.com/xwiki/bin/view/Documentation/rsmc-query

Hope this helps.





Print Page | Close Window