> Hi,
>
> I'm trying to extract visitor information  from the database and notice
> that a number of functions haven't been implemented. For example I would
> like to display the Address information of a specific user but the
> function getAdress1() doesn't exist.
>
> Should I wish to implement this where should I begin?
>
> TurbineMapBuilder, TurbineUserPeer and/ TurbineUser??? Perhaps all
> three?

If you wanted to make as few changes as possible (i.e., none), you could just
use the following:
    String address1 = (String)data.getUser().getPerm("ADDRESS1");

Obviously, that is not the most elegant way to do it. You could add code to all
those classes which basically boils down to the following in TurbineUser:
    public String getAddress1() {
        return (String)data.getUser().getPerm(TurbineUserPeer.ADDRESS1);
    }

The problem with doing that, however, is that to get to it from RunData, you'd
have to cast the value returned by getUser(). For example:
    TurbineUser turbineUser = (TurbineUser)data.getUser();
    String address1 = turbineUser.getAddress1();

Getting around that would require adding a getAddress1() method to the User
interface, which IMO would be a very bad thing. (I'm sure I'm not the only one
who'd -1 that change. ;-)) The User interface should be as thin as possible to
make creating alternative implementations much easier. Therefore, your best bet
may be to just use the non-elegant code fragment described above. :-)

> Or is it better to use Torque to produce these components?
>
> Thanx in advance.
>
> Colin
>

--
Christopher Elkins



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to