New Posts New Posts RSS Feed: hiding the serverside assemblies
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

hiding the serverside assemblies

 Post Reply Post Reply
Author
Dominique View Drop Down
Groupie
Groupie
Avatar

Joined: 28-Jun-2007
Location: Norway
Posts: 44
Post Options Post Options   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Topic: hiding the serverside assemblies
    Posted: 10-Sep-2007 at 2:41am
Hi,
I am calling som server methods from my client through the BOS. By now I have to reference the assembly where the statics mtehods lives because of the way I am calling them. please see code snipet under.

Dim pDelegate As New IdeaBlade.Persistence.ServerRpcDelegate( _
AddressOf MyMiddleWareNamespace.MyMiddlewareService.MyMethod)
Dim pArgs(1) As Object ' the arguments required by the method
...
'calling the service:
result = CType(mpersistMng.InvokeServerMethod(pDelegate, pArgs), MyReturnType)

My question is how can I hide the implementation of those methods? is it enough to refactor them out in another assembly? (I have some connection string etc)

my server code looks like this:

<DFp.AllowRpc()> _
      Public Shared Function MyMethod( _
        ByVal pPrincipal As Security.Principal.IPrincipal, _
        ByVal pResolver As DFp.DataSourceResolver, _
        ByVal ParamArray pArgs() As [Object]) _
      As [Object]
dim result as new MyReturnType()
if CheckPrecond(pArgs) then
dim myArg as Atype = WriteAtype(pArgs)
result = MyMethod(myArg)
end if
return result
end class

so I think it wouldn't be so much work to do such a refactoring :-)

Dominique


Edited by Dominique - 10-Sep-2007 at 2:43am
Dominique
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 11-Sep-2007 at 11:09am
I'm not sure I fully understand your question, but here's a little background information.
 
- On the client side, the InvokeServerMethod has several overloads to allow you to pass either a delegate to your method or just a type name.  So, if you pass the type name (eg, "Demo.Entities.Employee, Demo.Entities") you don't need to reference the assembly on the client.
 
- The InvokeServerMethod call is as secure as any other BOS call.  A SessionBundle is passed from the client to the BOS, and is validated on the BOS before calling your method.  The IPrincipal for the client is also extracted from the session bundle and passed to your method so you can do further validation.
 
- Your server-side method can do whatever validation you require, and can also call other server-side logic to do the bulk of the work, and that other logic can reside in server-side only assemblies too.
 
Not sure if this answers your question.
Back to Top
Dominique View Drop Down
Groupie
Groupie
Avatar

Joined: 28-Jun-2007
Location: Norway
Posts: 44
Post Options Post Options   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Posted: 11-Sep-2007 at 11:59pm
Hi,
Edit: by 14.09 it is not possible to call a ServerRpcPersistenceDelegate by invoking the classname. The clientcode must therefor call the delegate directly which means that the clientcode must hold a reference to the server side code.
end edit

Thank you for your answer. I will call the methods with the strings name as I emailed you. The main reason for using the delegate was the ease of use with the intellisens in Visual Studio.
just for information.
I tried to split the server side dll in to assemblies, one holding the "interface" of the service (does the parsing of args()..) and one with the implementation (and the sensitive DB info). It was then possible to not deploy the one holding the actual implementation. That will require to exclude the DLL from the publish list in a click once deployement. Any way it feels a bit overkill to have 2 assemblies for 5 methods. :)

Dominique

Edited by Dominique - 14-Sep-2007 at 12:03am
Dominique
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down