this is more of a question for john/frank, but i'm posting it here in an
effort to teach others and keep communication open...;-)

I'm almost done with the XMLDatabaseMapBuilder...it totally rocks.
Implementing with a SAX2 parser methodology turned out to be quite simple
and painless.

Now, the part that Frank and John are going to kill me on (because we have
another couple projects that will need to be updated as a result) is that I
want to totally re-work this entire structure of Map building...here is my
proposal:

public interface DatabaseMapBuilder
{
    public build()
    public getDatabaseMap()

    public TableMap getTableMap( name )
    public ColumnMap getColumnMap(table, col)
}

public abstract class BaseMapBuilder implements DatabaseMapBuilder
{
    // put common methods here.
    public TableMap getTableMap( name ) {
        return getDatabaseMap().getTable() }
    public ColumnMap getColumnMap(table, col) {
        return getDatabaseMap().getColumn() }

    // include stuff for reflection...see below...
}

/**
    current DatabaseMapBuilder gets moved into here...it is essentially
    obsolete now, but I want to keep it around for reference if someone
    needs it
*/
public class HardCodedMapBuilder extends BaseMapBuilder
{   // existing code remains...  }

/**
    this is the new XML builder...
*/
public class XMLDatabaseMapBuilder extends BaseMapBuilder
{}


currently, there are ugly hardcoded methods in the current
DatabaseMapBuilder...so, in the RolePeer, we currently have something like
this:

private static final String ROLD_ID = mapBuilder.getRole_RoleId();

So, my proposal would be to make those methods available via
reflection/introspection instead being hard coded...kinda like the way that
Ant works...

so, each table/column in a database would get a method like the one below in
the MapBuilder itself:

getTABLE_COLUMN()

now, the part that i'm not sure about is actually how to implement that
portion of things...in a hard coded situation, it is easy, but i don't have
a lot of experience doing introspection...

suggestions?

-jon



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to