Another pool of entities

November 29, 2007 15:36 by Rob

Dear readers,

 I'm working on a new beta release of EntityPool. The previous releases used only framework 1.1 features and that's practically stoneage. This is the first major update since long time ago. Therefore I decided to call it version 2.0b. Here's a small summary of the changes:

  • 2.0 Generics support including dynamic iterators for dramatic speed increase when working on large collections (see below).
  • Configuration of the connection strings using the new <connectionStrings> settings.
  • Configuration of filters through the web.config/app.config instead of hardcoded attributes.
  • Additional interfaces and events:
    • IConstructedCallBack - an interface that is called after your entity has been constructed from storage
    • IPersistedCallBack - an interface that is called after your entity has been persisted.
    • IRelationBuilder - allows you to define a builder that is used to construct a relation property
    • ConverterAttribute - allows you to declaratively define a converter that is used to map Database values to Entities and vice versa.
  • Strangely enough, there are not that many bugfixes. Maybe the code worked as it should?

As said, you now can specify your query filter in the configuration file instead of using an attribute:

[EntityPool.DefineFilter("byCategory", "Category = @b", "@b")]

You now specify:

<entityPool>


....


 <types>


  <type class="Demo.Objects.Category" assembly="Demo">


   <filters>


    <defineFilter name="byCategory" where="Category = @b" arguments="@b"/>


    <defineFilter name="all" where="1=1 order by Category"/>


  </filters>


 </type>


</types>


</entityPool>

 


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: C# | EntityPool
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Comments

Markuz

December 3, 2007 14:28

Hey Rob,

As a big fan of the EntityPool, I'm very curious about the latest version you're developing.

Is the new version also able to handle nullable types? I don't know if it's the responsebility of the Entitypool, but with the current version DB-nulls for a DateTime or int field could not be mapped as a property of a object. As it's based on 1.1, it probably doesn't know the DateTime? and int? types Smile

Maybe you can add a bool to the "DefineFilter"-attribut called : "IncludeWhere". You can set this to false when you only want to create a filter for ordering or create more complex queries.

SeeYa!
Mark

Markuz nl

Rob

December 4, 2007 00:04

Thanks again, Mark.

The idea for nullable types is very cool, and I'll surely introduce them RSN (Real Soon Now, tm). Hadn't thought of that yet. And of course the DefineFilter needs additional properties for settings the ordering clause (instead of putting it in the where part).

I did think of adding a filter composition class set to compose filters at run time but that kind of defies the point of having all your queries centralised. Next to that, I think LINQ is much better suited for that kind of interfaces.

Anyway, nullable types are coming up!

Rob nl

Comments are closed