This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I am trying to get a understanding of how Lightspeeds Distributed Unit Of Work is used. I have looked through the ATM example (as mentioned on another thread), but I am unsure of what is required still in order to build an application (without using DTO's) by exposing my entities. I found a thread where another user had found an old thread which has a simple to understand example but there was no link to the example and I can not find the old thread. Is it possible to get a nice simple winforms distributed example?? Currently I use C# VS2012 and Lightspeed 5. Cheers and thankyou. Mike. |
|
|
Hi Mike, Have you had a read through http://www.mindscapehq.com/documentation/lightspeed/Building-Distributed-Applications-/Distributed-Entity-Programming ? In your scenario what where would the DistributedUnitOfWorkService be hosted? (e.g. what is going to be serving up the entities), Im assuming the WinForms client is going to be your client?
|
|
|
Jeremy, Yes that correct, my winforms app is the client. The DistributedUnitOfWork will be serving up entities thats correct, the WCF service will be hosted in IIS. I had a look at the chaptor suggested above was still stumped as to how to structure the application and how it all fits together, how and if lazy loading still works as it does with the local UnitOfWork. So basically i am just looking to see how it fits together and operates. Once again thank you for you help. Mike. |
|
|
It sounds like you will want a web application hosting the DistributedUnitOfWorkService (server side) and then your WinForms application will be using the DistributedUnitOfWork (client side). On the server side you will want to host the service by exposing a WCF .svc file and then implementing a service class which will be instantiated as required. An example of this is in the ATM sample. If you open up that sample and look at the Website project you will want to duplicate the following:
Once you have equivalent files set up in your web application you will need to define the following configuration, where you update the name attribute to match your service classes fully qualified name. You can also change the binding type if needed, e.g. you might prefer to use netTcpBinding for better performance if you are working within a local intranet.
On the client side have a look at the following classes from the Teller project in the ATM sample:
After this you will just create your UnitOfWork instances normally, e.g.
Let us know if you have some more specific questions about this. Hopefully there shouldn't be too much required to get this configured.
|
|
|
Jeremy, Thankyou for the break down that helps alot. One question though, does lazy loading work as it would if it was a local UnitOfWork??? Cheers and thankyou again. |
|
|
Yes thats right :)
|
|
|
Sweet :). Cheers . |
|
|
Surprisingly, I am not able to finding the sample applications. Can you please give me the links for sample ATM application? |
|
|
The samples are located under C:\Program Files (x86)\Mindscape\LightSpeed\Samples assuming a default installation path on a 64 bit machine. The ATM sample can be loaded from the ATM.sln solution file in the samples folder.
|
|