Forums

Get More Support

Here for you 24/7

learn more
VOD Free SDK

Start Building your Engine Now

Download Now
VOD Extranet

Access to patches, license management,
tech docs and more for existing VOD customers.

Learn More
How to ensure generic reflector is not needed
Last Post 28 Jan 2010 01:56 PM by Carl Rosenberger. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
mnemosyn
New Member
New Member
Posts: 14


--
24 Jan 2010 09:37 PM

    Hi there,

    is there a way to make sure the generic reflector is not used in a client/server scenario? Of course I'm trying to deploy all needed dlls, but I also try to constrain myself to the actual data model, instead of pushing everything to the server. Or would you simply deploy all dlls?

    What do you think?

    Chris

    Tags: generic reflector, client-server, deployment
    gamlerhart
    Advanced Member
    Advanced Member
    Posts: 790


    --
    25 Jan 2010 04:49 PM

    Well I think the most elegant and also quite simple approach is this:

    Create a assembly which contains your all your persisted classes. And then use this assembly on the server and the client. However versioning can be a problem. When to client and server have different versions of the assembly with different classes it may produce strange effects.

    mnemosyn
    New Member
    New Member
    Posts: 14


    --
    25 Jan 2010 05:03 PM
    From what I understand, one should always supply the model assembly to the server for performance reasons, right?

    Now the trouble is to create the assembly which contains all persisted classes. The project is quite complex and I might keep a reference to some object (that probably should not be stored) which is not part of the data models assemblies. If that happens, I'd like to get some kind of notification... Perhaps I just walk basically everything stored in the DB from time to time and reflect my assemblies to see whether that object type is known in there? That is probably possible, but I was hoping for a simpler solution.
    Carl Rosenberger
    Veteran Member
    Veteran Member
    Posts: 2171


    --
    28 Jan 2010 01:56 PM

    You could listen to Creating events, get the newly stored object from the event args and throw if it's of a Type that you don't expect to be stored.

    For a sample of how such a listener is created see Db4objects.Db4o.Tests.CLI1.Events.EventRegistryTestCase in the sources.

    You are not authorized to post a reply.


    Active Forums 4.3