EasyObjects 1.2 Released

by Matthew Noonan 28. November 2006 06:17

It's been a long time coming, but NCI is pleased to announce the availability of the EasyObjects.NET 1.2. While this version only supports .NET 1.1 and the June 2005 Enterprise Library, the features will be ported forward into the upcoming 2.0 version. If you find any problems with this release, please contact the support staff immediately so that we may correct it as quickly as possible.

Thanks for choosing EasyObjects as your development platform!

Change log for EO 1.2:

Click here to download EasyObjects 1.2

Tags:

Man, what a week!

by Matthew Noonan 13. November 2006 05:35

I'd have to say this last week has probably been the most productive I have been in a long time. At the risk of sounding like I'm tooting my own horn (guilty ), here's a list of things I scratched off my lengthy TO DO list:

  • Checked in final changes to EasyObjects 1.2, including the new WhereParameter operands, client-side default value handling, a slew of new NUnit tests, and some enhancements to the business entity and concrete class templates. (Note: these are not in the RC)
  • Created the new EasyObjects SQL Stored Procedure template from the old SQL DAAB template, in order to bring the naming convention and namespace more in line with the EasyObjects brand name.
  • Ported all of the 1.2 changes to the 2.0 platform.
  • Revived the MSAccess and VistaDB add-on modules, moved them up to the 1.2 code base and started porting the NUnit test suite. (More on this next week!)

All I can say is, whew!

I expect that the EO 1.2 release will occur either next weekend or the weekend after that. Things are hopefully going to start happening more quickly now.

Tags:

StartsWith, EndsWith and Contains

by Matthew Noonan 9. November 2006 20:02

This always bugged me at the back of my mind, but I could never put my finger on it. When writing LIKE queries in EasyObjects, how come I have to include the wildcard character in the value? See this example:

 obj.Where.LastName.Value = "J%";
    obj.Where.LastName.Operator = WhereParameter.Operand.Like;
    obj.Query.Load();

Isn't EO supposed to be database-neutral, with different dynamic query providers for each database? Won't my query break if I move to a platform that uses a different wildcard character?

Once I managed to identify the problem, the solution became immediately obvious: developers should not specify the wildcard character when doing LIKE queries. So I have added the following Operands to the 1.2 release of EasyObjects:

  • StartsWith
  • EndsWith
  • Contains
  • NotStartsWith
  • NotEndsWith
  • NotContains

So now, the first example looks like this:

 obj.Where.LastName.Value = "J";
    obj.Where.LastName.Operator = WhereParameter.Operand.StartsWith;
    obj.Query.Load();

This is a far better solution for writing portable queries. The DynamicQueryProvider class will add the proper wildcard character for the database and in the correct position(s) to perform the query. The LIKE and NOT LIKE operands will still be supported for backwards compatibility, but you should move to the newer constructs so your queries can be more easily ported across platforms.

Note: For those of you quick on the uptake, yes, I know that Oracle and SqlServer both use the same wildcard character. Those will not be the only 2 platforms forever. I am working on it.

Updated 1.2 Release Candidate

by Matthew Noonan 2. November 2006 03:47

I have updated the 1.2 Release Candidate, hopefully for the last time before release. This RC includes the client-side default value handling logic. That means if a database column has a default value defined and you call AddNew(), the column should have the default value immediately in the new row. In addition, I have added even more NUnit tests to check for all this automatically, so any future code updates can be regression-tested with some level of confidence.

If you find any bugs or omissions (especially you folks in the Oracle camp), please let me know quickly so I can fix them. If I don't hear anything, I plan to release the official version this month. In the meantime, I'm going to work on updating and adding some new content to the site.