New Posts New Posts RSS Feed: Custom Entity Server
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Custom Entity Server

 Post Reply Post Reply
Author
raustring View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Apr-2010
Location: Antigua
Posts: 3
Post Options Post Options   Quote raustring Quote  Post ReplyReply Direct Link To This Post Topic: Custom Entity Server
    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.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
raustring View Drop Down
Newbie
Newbie
Avatar

Joined: 26-Apr-2010
Location: Antigua
Posts: 3
Post Options Post Options   Quote raustring Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post 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?
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down