Print Page | Close Window

DevForce App with no Database

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=503
Printed Date: 11-Jun-2026 at 3:10pm


Topic: DevForce App with no Database
Posted By: IdeaBlade
Subject: DevForce App with no Database
Date Posted: 16-Oct-2007 at 1:10pm
So you want to write an app that has no database!  I take it that the client app is a UI for capturing information and storing it on the user's PC. It never reads or writes to a database. Is that right.
 
You can do this (it took me a second to think this way as we've never had an app with no db before as far as I know).
 
You started as I would have: "creating business objects based on a sql database model and then dropping the database".
 
[aside: You don't have to drop the database and I would not. This is your design database and it's good to have it around as you evolve your business object structures. When you ship the app, the db won't exist at the client's site but that will be OK as you're about to see.]
 
You are correct that DF tries to connect as soon as you call CreateEntity. It will try to connect under almost all circumstances. In this case, it wants to check the database for the current schema info.
 
You can prevent this by forcing the PM to disconnect BEFORE you use it: PersistenceManager.Disconnect();
 
Now when you call CreateEntity, the PM knows it can't reach the database and relies on local knowledge of the entity schemas



Replies:
Posted By: jeffdoolittle
Date Posted: 16-Oct-2007 at 4:03pm
This makes me think of an interesting question:

Why can't DevForce just look at an ADO.NET DataSet for mapping entities?  this would make it even easier to design your entities without a backend database. 

I have an XSD file, it seems that it would be trivial for DevForce to inspect the XSD and build entities accordingly.

Hmm...


Posted By: jeffdoolittle
Date Posted: 22-Oct-2007 at 11:56am
I would appreciate it if someone from IdeaBlade could respond to my previous inquiry regarding XSD files and ADO.NET. 

Regards,

--Jeff


Posted By: davidklitzke
Date Posted: 22-Oct-2007 at 4:38pm
Using an XSD file is another way to solve the problem.
 
I don't know that either solution is "better" or "easier".  In your case, the XSD file may be readily available making it perhaps easier for you.  In our case, this file is not usually available, and we would have to go through a fair amount of effort to manufacture one.
 
Ultimately, I think this is a matter of preference.


Posted By: jeffdoolittle
Date Posted: 22-Oct-2007 at 9:09pm
So are you saying that the capability currently exists to build your entities from an ADO.NET XSD file?


Posted By: davidklitzke
Date Posted: 23-Oct-2007 at 8:00am

We have no utiliities that I know of that will construct an EntitySet from an XSD file.

We do have a Tech Tip on Crystal Reports that contains a utility that will build an XSD file from the DLL in your Model project


Posted By: jeffdoolittle
Date Posted: 23-Oct-2007 at 9:07am
I'm not talking about building an EntitySet.  I'm talking about pointing the Object Mapper at an XSD file instead of at a database.  It seems to be that this shouldn't be too difficult.  This would allow a developer to create their object model without an actual database.

The discussion is probably more academic than practical, because a developer could just load a free version of SQL Server for development purposes.  But, I'm just trying to understand what would preclude the DevForce object mapper from being able to build the object map from an XSD file.

--Jeff


Posted By: kimj
Date Posted: 23-Oct-2007 at 9:32am
Jeff, pointing the Object Mapper at an XSD or XML file is something we've discussed internally, and even have a low priority feature request filed.  It's stayed low priority due to the usual reasons - we have very few resources and spend most of our time battling bugs and those features that someone needs ASAP. 
 
So, no promises on when this feature will be added, but it is definitely something we'd like to include.


Posted By: jeffdoolittle
Date Posted: 23-Oct-2007 at 11:00pm

Thanks for the reply.  If I come up with a compelling business case for this, I'll let you know.  In the meantime, I'm content to let the issue rest.

--Jeff




Print Page | Close Window