Posted on June 13th, 2007%
I just updated WilsonORWrapper to include a Query<T> class that simplifies using OPathQuery<T> objects. To illustrate, I’ll take the content from the newly-written Services page on the project wiki (which also gives an overview of the Data<T> service).
The Query service provides a simple interface to generating OPath queries. It helps simplify code by avoiding the need to explicitly use the Wilson.ORMapper namespace to generate OPathQuery objects.
Using the Query service is best illustrated by comparing how you would generate an OPathQuery using the Wilson.ORMapper namespace, and how you would generate a query using the Query object (which hides the underlying OPathQuery object from your code).
Querying using OPathQuery<T>
using Wilson.ORMapper;
using WilsonORWrapper.Services;
…
OPathQuery<User> query = new OPathQuery<User>("Name = ?");
User user = Data<User>.Retrieve(query, "Brian");
Querying using Query<T>
using WilsonORWrapper.Services;
…
Query<User> query = new Query<User>("Name = ?");
User user = Data<User>.Retrieve(query, "Brian");
Note the similarities of the code. The usage of Query<T> is the same as OPathQuery<T>, but you are saved the hassle of dealing with a separate . . .
→ Read More: Query<T> added to WilsonORWrapper
Posted on June 1st, 2007%
About a month ago, I wrote about a major update coming to WilsonORWrapper, the code library/code generation templates I put together for Paul Wilson’s O/R Mapper. Finally, it’s available!
The source code, releases, API documentation, and some (but far from enough) how-to sections are available on the WilsonORWrapper project site.
For those who used the previous version of the wrapper, there are some major breaking changes in here, but it’s not incredibly time-consuming or difficult to make the transition. The namespace hierarchy is changed somewhat, the configuration settings are changed, and some core classes have different method names, but overall it shouldn’t take long to convert. (I converted a project with about 30 entity classes in about 60 minutes.)
Every few days, I’m going to add to the “how-to” documentation, focusing on a different part of the library each time. Until then, there’s still plenty of stuff to check out.
WilsonORWrapper Project Home
Latest releases and links to online and offline API . . .
→ Read More: WilsonORWrapper: better, stronger, (maybe) faster
Posted on May 4th, 2007%
A few weeks ago, I released WilsonORWrapper, a framework built around Paul Wilson’s O/R mapper. Since then, I’ve been busy rewriting it, improving existing features and adding new features to the mix.
There’s a lot of changes coming, and there are many breaking changes. Among the biggest changes include:
Single assembly distribution. The previous Entities and Services namespaces are now combined into a single DLL.
Integrated logging services. Logging services to log to the Windows Event Log or to text files using NLog or Log4Net is included. O/R mapper command interception is activated for all debug logging levels. Adding other logging services will be easy in the future, thanks to a pseudo-provider model.
Integrated cache services. A caching framework is available, and a cache interface to the ASP.Net cache is included. Caching to memcached will be added in the near future. Adding other caching services will be easy in the future, thanks to a pseudo-provider model.
Simplified configuration and initialization. . . .
→ Read More: Major revamp of WilsonORWrapper coming
Posted on April 30th, 2007%
As part of the overhaul of the WilsonORWrapper, I’m adding a cache service. To do this right, I need to implement an ICacheClient interface. This interface will define the methods and properties which any cache client will need to implement.
Sounds simple on the surface, but I quickly ran into a problem. What do you call your methods? Consider the following possibilities for naming four core methods.
Retrieving an item from the cache: Get, Retrieve, Load, Fetch, Read, Select.
Placing an item in the cache: Put, Set, Add, Insert, Save, Update.
Determining if an item exists in the cache: Contains, Exists, Has.
Remove an item from the cache: Remove, Delete, Clear.
Clear all items from the cache: Flush, Clear, ClearAll, DeleteAll, RemoveAll.
The worst part of determining a naming convention is that you are generally stuck with it once you choose it, unless you want to implement breaking changes into your application.
Most of the names above were found in some cache API currently in existence today. (I . . .
→ Read More: Choosing method names for a cache interface
Posted on April 10th, 2007%
I’ve just added a zipped release that includes compiled binaries and CodeSmith templates for WilsonORWrapper. This should be helpful to those who aren’t familiar with (or who don’t want to bother with) Subversion and NAnt and the joy of building your own release.
. . .
→ Read More: Binary distribution of WilsonORWrapper available
|
|