Print Page | Close Window

n--tier sample

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1235
Printed Date: 16-Apr-2024 at 4:58am


Topic: n--tier sample
Posted By: mjwills
Subject: n--tier sample
Date Posted: 27-Apr-2009 at 2:25am
My current project (soon to finish) involved using Entity Framework over WCF. We ran into some issues with this approach (primarily around complexity involved with handling detached vs attached objects) so I thought I'd have a look at DevForce EF / WinClient.
 
Can someone point me to a simple n-tier sample application? Something that supports pulling back multiple instances of an entity (for display) and then insert / delete / update functionality. This would be very helpful in investigating whether the kind of issues we had with vanilla WCF / EF would be overcome with DevForce.
 
I recently watched IdeaBlade's Silverlight video from MIX09 - that kind of sample would be perfect (but with WinForms (preferred) or WPF client, accessing middle tier over WCF, with middle tier accessing SQL Server backend). Note that what it 'looks' like doesn't matter - but it does need to be reasonably easy for me to change / fiddle with (to allow some level of comparison with our existing approach).



Replies:
Posted By: GregD
Date Posted: 28-Apr-2009 at 10:24am
mj:

The "Adding and Deleting Entities" learning unit in the 200 Intermediate series includes insert / delete / update functionality with a WinForms front end.

It can be run n-tier with minor adjustments.  You can use the "N-Tier Configuration Starter" tool on the Start / IdeaBlade DevForce / Tools menu to create the client- and server-side configuration files, and to create folders with the files needed for client- and server-side deployment. Then you just launch the ServerConsole.exe program in the Server folder to start the BOS, and you're running n-tier on a single machine (BOS and client app in separate processes).

The part 2 tutorial in the "LINQ, Entity SQL, Deployment Tester", also in 200 Intermediate, steps you through the use of the n-tier configuration starter.

But note that all DevForce apps are logically n-tier, and standard procedure is to retrieve entities to the local cache, modify them locally as desired, create new entities locally, and ultimately save to a back-end datasource.  For this reason, any of our sample solutions can be deployed n-tier with the minor adjustments outlined above.

For new entities created locally, DevForce supplies temporary key values and performs primary and foreign key fixup at save time.  When you delete an entity locally, its DevForce EntityState gets set to EntityState.Deleted; when you then save to the back-end datasource, the deletion is consummated there, and the local entity's EntityState gets set to EntityState.Detached.   It subsequently gets treated as if it did not exist by all client-side operations.

Please let us know if you have further questions.


Posted By: mjwills
Date Posted: 30-Apr-2009 at 7:22pm

Thanks - I'll have a play with that today.




Print Page | Close Window