Print Page | Close Window

Custom Entity Server

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=1958
Printed Date: 04-Feb-2026 at 3:37am


Topic: Custom Entity Server
Posted By: raustring
Subject: Custom Entity Server
Date Posted: 11-Jul-2010 at 6:24am
Is it possible to write a custom 'entity server'? If so, do you have an example that shows how to do this? I'm not sure if creating a custom entity server is the right approach but I essentially would like to create my 'entity manager' using a database (i.e. as is done today in your examples), but have the option of populating those entities from something other than a database (e.g. XML). This would allow the end user of my application to store there data in either a database or XML files. Using XML to store data would be used in scenarios where there is a relatively small amount of data or simply to store test data.



Replies:
Posted By: ting
Date Posted: 12-Jul-2010 at 7:38pm
I'm don't think creating your own Entity Server is going to be the right solution.  Our POCO functionality is designed to allow you to work with data from non-database storage.  For test entities, you can save EntityManager's cache state to a file, so that you can do testing without a database.  This post has some more information about that:
http://www.ideablade.com/forum/forum_posts.asp?TID=1688 - http://www.ideablade.com/forum/forum_posts.asp?TID=1688 http://www.ideablade.com/forum/forum_posts.asp?TID=1688&KW=test -
 


Posted By: raustring
Date Posted: 13-Jul-2010 at 8:40am
If I went with a POCO approach, how do I turn off the database access on the server? I would like to generate the 'entity manager' using a database, since I still want the option of running from a database as well and I want the same model objects whether or not I'm running from a database or XML. I can see from your examples and documentation of how the database update logic can be intercepted for saving, but I don't see any method to 'turn off' the database read access on the server or where the 'entity manager' on the server can be initially loaded with the data from the XML files.

The link that you referred me to above seems to imply running in a disconnected fashion and saving and loading the 'entity manager' on the client with saved data. I still need communication between the client and the server, but would like to have the option of using XML to store my data on the server.

Sorry for the basic questions, but I'm new to your product and still trying to understand if I can use it for my purposes.


Posted By: ting
Date Posted: 13-Jul-2010 at 8:38pm
Yes, the link above was in response to your statement about storing test data.
 
DevForce works the best when the primary datastore is a relational database.  We provide POCO integration to allow people to bring in other adjunct data and have it managed in the same way as a DevForce Entity, but if that is your primary use case, quite a bit of the DevForce value is lost.  Do I understand correctly that you want to have the same "schema" hosted by a database sometimes, and by an XML file other times, and you want to be able to toggle between the two?
 



Print Page | Close Window