Hi all.

I have a question about the context implementation of the commons-chain project.

I think it is a good way to have JavaBean Properties in a context like:

private User user;

with get()- and set()- Methods like

public User getUser() ... and so one

So you have type-safeness.

What is the benefit of "Attribute-Property Transparency" (I don't hear this concept before). You get the attributes via

User user = (User) context.get(getUser());

where getUser() in this case returns a string to have access to the propery. The benefit is to avoid having fixed strings like

User user = (User) context.get("user");

Now you have the handicap, that you must cast the value into the real type and all benefit of having JavaBean properties are away. The other way I would prefer.

Regardless having JavaBean properties or some "untyped" values in the Map: Every values will store in the same Map. Than you have a nice possibility to clone contextes in an easy way.

Example:

class myContext extends Context {

private String userString = "user";

// --- Property User private User user;

public User getUser() {
return (User) get(userString);
}
public void setUser(User user) {
put(userString, user);
}
}


Perhaps somebody can me more explain about the benefits of the current implementation.

Manfred



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to