Jan 92009
I revisited the Metro ServiceFactory after John Whish's recent question about how Metro instantiates concrete classes. After a bit of trial and error, I'm happy to announce that the ServiceFactory now supports the creation of concrete gateways without requiring a concrete service in the same package. Before I outline how Metro resolves the class path for instantiating a Service and composed Gateways, I'll describe the basic conventions one must follow to use Metro.
Read more...
May 262007
Now bundled with its distant cousin, the composite Iterator,
Recordset provides methods and properties for list traversal via inheritance. Recordset is not a query, but rather a query that is converted to an array of structs. Extending Recordset is useful as an alternative to maintaining an array of objects, or if you want to display a list with calculated fields (an employee has
a startdate, but display format is "years of service").
Read more...
May 152007
To go along with my previous woolgathering on the
correlation between a database schema and a class package, here is another observation regarding class inheritance and sub/supertype tables.
In object modeling, we describe the relationship between a subclass and superclass as "is a". The same goes for tables in a data model, where the subtype "is a" supertype. The obvious benefit of using inheritance in object modeling is code reuse. When we add, remove or alter a method of the superclass, the change is automatically inherited by the subclass. In a data model the benefit of using subtypes is arguable. The benefit are that your model better represents the domain, reduces data duplication and (depending on the extent of your normalization) eliminates NULL values. The trade-off is that you are thereafter required to use joins when reading records and transactions when creating, updating or deleting records.
Read more...
Recent Comments