• .NET

    Generic Data Access

    When using an ORM one of the first questions users have is: But how is my data accessed? OpenAccess uses a technique called Enhancement to augment the compiler generated code. It works like as if the compiler had weaved in some additional code - much like the AOP people are doing it. The added code allows to provide the application with the needed management, lazy loading and change tracking capabilities. Because the code is compiled, there is no need to use reflection and therefore guarantees you a speedy access to your data. Your database data just comes into the objects as...
  • .NET

    Designing N-Tier Applications with OpenAccess ORM

    April 28, 2009 Share
    A very important question recently crossed my inbox, and it essentially asked: “Can you design and build Enterprise-grade n-tier applications with OpenAccess? Or does it force you violate principles of good multi-tier application design to make the ORM features work?” It was a great question and I was surprised to find that there is not more info in the online docs to address this. So, to help everyone benefit from this question’s answer, here are some details about building n-tier applications with OpenAccess. WHAT DOES GOOD N-TIER ARCHITECTURE LOOK LIKE WITH OPENACCESS? Let me preface this discussion by saying there is no “absolute” right...
  • .NET

    Insert, Update, Delete with OpenAccess and RadGridView for Silverlight

    February 04, 2009 Share
    Download I will show you how easy is to integrate OpenAccess with RadGridView for Silverlight. I get the example from my colleague Dimitur and make it work with our RadGridView. If you are interested how to make OpenAccess to work with ADO.NET Data Services please read his blog series. To allow inserting new rows in RadGridView we should attach to AddingNewDataItem event. <telerik:RadGridView x:Name="gridView" Grid.Row="1" AddingNewDataItem="GridViewAddingNewDataItem" /> And provide the newly created object in it. private void GridViewAddingNewDataItem(object sender, GridViewAddingNewEventArgs e) { e.NewObject = new Supplier(); } Now we can insert new objects. Next steps is to save changes to the database. We should attach to GridViewRow.EditEndedEvent. this.gridView.AddHandler(GridViewRow.EditEndedEvent, new...
  • .NET

    Simplifying OpenAccess Scope in ASP.NET with HttpModule

    January 20, 2009 Share
    Whenever you start working with a modern ORM tool, one of the biggest challenges is figuring out how to manage the "scope" (or sometimes called "context" or "data context"). It is this transactional space where the ORM tool keeps track of changes being made to "persistent objects" in your application so that they can be saved to your "persistence layer" (usually a database) when you're ready to commit them. But figuring out when to create a scope, when to close it, and all the annoying problems that result from closing a scope too early can be very frustrating, and they...
  • .NET

    Improving OpenAccess ObjectScopeProvider for Runtime Connection Config

    January 09, 2009 Share
    Phew! That's a long blog post title, but hopefully it clearly conveys what I'm about to show you. In my last post, I talked about where you should set your OpenAccess database connection strings. I showed you how you can define multiple database connections in your web.config (or app.config), simulating the idea of having a unique connection string for DEV, TEST, and PROD environments. So now that you have your connection strings set in a way that is easy to maintain, you need a way to easily to tell your OpenAccess persistent classes to use a specific connection at runtime. Let's look...