With talk of JRE5 coming up I thought this would be a good time to
approach the idea of a ModelElementFacade again.
With all model elements outside of the MDR model subsystem being
refered to as Object we miss out a fair deal of the readability that
comes with JDK5 syntax.
What I'd like to see is instead of passing and returning model
elements as Objects that we define our own ModelElementFacade
Somthing like this -
class ModelElementFacadeImpl implements ModelElementFacade {
/**
* A reference to the MDR model element
*/
private ModelElement modelElement;
/**
* Our own deleted flag to help with undo
*/
private boolean deleted;
/**
* Not public so only flyweight factory can access this
*/
ModelElementFacade(ModelElement mdrModelElement) {
modelElement = mdrModelElement;
}
/**
* Allow the MDR model subsystem only access to the actual model element
*/
getModelElement() {
return modelElement;
}
/**
* Allow anyone to use this facade to get the name of the model element
*/
public String getName() {
return modelElement.getName();
}
/**
* Get the deleted property
*/
public boolean isDeleted() {
return deleted;
}
}
What are peoples thoughts on this in principle?
What's the best way of getting from where we are now to returning
wrapped model elements?
Bob.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]