In an earlier post, whilst I was mid-rant about the PDC (well, as close as I get to a rant anyway :), I mentioned that I had a "potentially good idea" that I'd share with everyone "in another post". Well, this is that post...

The core of the idea is simple: model each problem/business/application domain as a data source, which implements a simple interface (or inherits from a simple abstract base class) for getting at that domain's objects. These in turn implement/derive from a simple entity interface/class which provides access to the object's properties and methods in a generic (think IDispatch, but don't say it out loud) way. Properties, by the way, need not be simple scalar values.

This does not get us very far, except maybe enforcing some sort of consistency amongst many apps if you happen to develop a lot of them, which I doubt is often the case. Where the idea comes into its own, IMHO at least, is in the things that you can then do:

  • Write "viewer" controls which are nicely decoupled from the data sources themselves
  • Write a simple explorer-like app which connects to a number of data sources, enumerates their objects, and allows access to the appropriates viewer(s) to display properties, and methods to perform actions
  • Write a more complex, but still generic, app which uses a UI data source to hold information about a workspace->page->control hierarchy to give a richer user-experience
  • Write simple wrapper data sources over existing APIs, e.g. RSS feeds, commercial apps
  • Write a data-driven data source (i.e. one which uses a meta data source) to allow:
    • easy construction of object models for use in "in-house" apps by MIS departments, say (again, think VB's heartland, but don't say it out loud)
    • easy (and quick turnaround) prototyping of object models and UIs before conversion to "real" ones
    • personal use, where support for calculated properties would convert the app from a universal object explorer into some sort of multi-dimesional, free-form extension of a spreadsheet
  • Write different data access implementations for the above data source, so that it could be based on XML files, SQL Server/MSDE, Oracle, MySQL, etc., etc.
  • Write a reflection-based wrapper/base class so that the implementation of the data source and entity objects is just a matter of adding metadata attribute tags to the appropriate classes, methods and properties
  • Write "adapters" which convert "viewers" for use in a different environment (e.g. an ASP.NET viewer could be hosted in a web browser control for use in a "rich" client, and a Windows control (or ActiveX control, even) based viewer could be embedded in a web page for use in a "thin" client)

A long time ago (well, before my daughter was born, anyway) I had thought about doing some or all of these in my "spare time" so that I could potentially profit from the endeavour, but since I don't have any spare time any more, I thought I'd open to idea up to eveyone for comment, suggestions, advice, offers of help, etc.. If there's any interest, I'd like to set up a GDN workspace or a SourceForge to allow collaborative development. Even if we don't get anywhere in particular, I imagine it would be an interesting journey, and having recently read Martin Fowler's excellent Patterns of Enterprise Application Architecture I'm especially eager to try some of them out. If, though, we get anywhere with the generic stuff, it'd be nice to consider doing some real applications. The main one that has occurred to me is a fully integrated, end-to-end software "production-line" (I've not seen any of the Rational suite of products, but I imagine I'm talking a somewhat simpler version of their concept). There seems to me to be a good chance of getting some good aspect-oriented stuff in here, possibly with entity properties driving code generation.

All feedback most welcome (within reason)...