By Peter Wiles on
Thursday, May 13, 2010 5:36 PM
One thing we've regularly needed to do is to load and save objects to multiple data sources. One example where this might apply is when your security objects (users, roles etc) are stored in a separate database to your application database. Another example is where you have application data and user preference data - the application data being stored to a centralised database and the user preferences being stored to a local xml file, and you would like a unified interface where you simply save objects and have them go wherever they should.
In Habanero 2.3.2 this can be achieved with a DataAccessorMultiSource. Here is an example:
|
By Peter Wiles on
Wednesday, March 31, 2010 5:34 PM
So the new Habanero version (2.3.2) is out, and one of the new features is an improvement in loading collections in the form of an IN operator (and its negative, not in). This works similarly to how it's used in SQL - in fact it gets translated into a SQL in clause if your Habanero app is running against a database. Here's an example of using it in loading a set of Person objects:
BusinessObjectCollection persons =
Broker.GetBusinessObjectCollection(
"Surname in ('Wiles', 'Powell', 'Naidu')");
It's a really intuitive syntax because of its close relation to SQL's in statement. Also available is the 'not in' operator which does exactly what it says - searches for items not in the given list.
If you want to load using the more type-safe Criteria objects, or you are using code to build up your criteria clause, you can do it like this:
object[] values = new object[]
{"Wiles", "Powell",...
|
By Peter Wiles on
Monday, February 01, 2010 9:28 PM
For part 2 in this series (which I've renamed slightly), we add some new domain classes to the nascent Bob's Pizza Place domain model with relationships between them. We also add a bit of logic to some of the classes to enrich the domain model with business logic. You can download the article in PDF format here: DomainModellingWithHabanero01-02.zip. This zip contains part 1 and part 2, as well as the final source for both.
|
By Peter Wiles on
Wednesday, January 27, 2010 5:25 PM
I'm putting together a series of articles for people new to Habanero to get basic idea of domain concepts and how to implement them in Habanero as simply as possible. They won't include any of the UI stuff, and won't use FireStarter, so it's first principles stuff, all manual. The core of Habanero is it's powerful Business Object layer, so this is what I'm focussing on here. I've attached the first in the series to this blog post below, and I'll put it up on the tutorial section of the site soon (which will be revamped too). I'd really appreciate any feedback, good or bad. Building and using a Domain Model with Habanero: Part 1- A Beginner's Guide.zip
|