Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I use a homemade DataAccess layer and it looks like this:</p> <pre><code>public class HoneyOpposumDAO : DataAccessObject&lt;lots of generics&gt; { public ICollection&lt;HoneyOpposum&gt; Select(Filter filter); public ICollection&lt;HoneyOpposum&gt; Select(); public HoneyOpposum FindByApplicationId(int id); internal HoneyOpposum FindByDatabaseId(int id); void Register(HoneyOpposum o); void Commit(HoneyOpposum o); void CancelEdit(HoneyOpposum o); void Save(); void Save(Filter filter); void Save(DbTransaction transaction, Filter filter); void Revert(); void Revert(Filter filter); void Revert(DbTransaction transaction, Filter filter); } </code></pre> <p><code>Filters</code> are composite structures to express <em>Filter Expressions</em> in <code>DataSets</code>.</p> <p>Basically, this is a three-tier DataAccess layer : </p> <ol> <li>Business objects (model)</li> <li>DataSets</li> <li>Saving structure</li> </ol> <p>Business objects have to register themselves using <code>Register</code>. Modification to these objects are confirmed to the model using <code>Commit</code> and can be undone using <code>CancelEdit</code>.</p> <p>Commited business objects can be saved to the underlying saving structure (e.g. SQL Server) using <code>Save</code> and all changes since the last <code>Save</code> can be undone using <code>Revert</code>.</p> <p>This DataAccess layer ensures control on saved <strong>and unsaved</strong> business objects. It also allows for seperate database and application ids.</p> <p>Unfortunately, the underlying code quite complexe... and copyrighted :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload