This question is locked. New answers and comments are not allowed.
I've been using OpenAccess for a while but I feel as if I'm using it incorrectly, that I'm perhaps writing way too much code to support it. So now I'm at the point of either figuring out a better way, or dumping it and going back to standard ADO.NET code. I am reading as much of the other posts and documentation that I can, but I'm hoping someone out there can help me see the light and give me a more concise answer.
At the moment, I have an n-tier application that will run across two or more physical tiers. I need WCF services to support remote Windows users and, at some point, web clients. I'm using WPF for presentation, with ObservableCollection objects as the basis for my data-binding. My BLL code does a lot of wrapping and unwrapping of OA persistent objects, and separately manages object state. I use client-side proxy objects to create and manage the ObservableCollection objects, which are implemented using the BLL objects, and those objects are then consumed by the UI.
When I started with OA, my impressions were that:
But now the work I'm doing is feeling more and more onerous. Updating a hierarchy of persistent objects, using my approach #2 above, becomes a real hassle because you have to ensure that all the objects are recreated before adding them to a transaction. And, of course, I lose the advantages that OA's caching would normally give me. Given a complex hierarchy, this activity can be painful.
So, my questions are these:
Thanks.
At the moment, I have an n-tier application that will run across two or more physical tiers. I need WCF services to support remote Windows users and, at some point, web clients. I'm using WPF for presentation, with ObservableCollection objects as the basis for my data-binding. My BLL code does a lot of wrapping and unwrapping of OA persistent objects, and separately manages object state. I use client-side proxy objects to create and manage the ObservableCollection objects, which are implemented using the BLL objects, and those objects are then consumed by the UI.
When I started with OA, my impressions were that:
- The persistent objects were not persisting across physical boundaries because it appeared that the scope was closing before delivering the data.
- As a result of #1, I was going to have to write intermediary code to deliver data changes into and out of the OA persistent objects.
- At the time, I felt that the disconnected persistent container was not going to work because of how I expected to use it in WPF.
- Creating my own BLL objects was easier because I could combine and manipulate the data elements.
But now the work I'm doing is feeling more and more onerous. Updating a hierarchy of persistent objects, using my approach #2 above, becomes a real hassle because you have to ensure that all the objects are recreated before adding them to a transaction. And, of course, I lose the advantages that OA's caching would normally give me. Given a complex hierarchy, this activity can be painful.
So, my questions are these:
- Is it worthwhile for me to continue to use OA (presuming I use it the way it was intended)?
- How can I maintain the SoC across the different layers (i.e. I want only my Data Access layer to contain any references to Telerik libraries)?
- Is it possible to pass a persistent object from OA to WCF, through SOAP to WPF, and back again, without losing the persistence and tracking mechanisms? Can lazy loading be used in this scenario?
- If I'm reverse-mapping, can I combine more than one table into a single data entity?
Thanks.