I skimmed this and didn't understand it well enough to comment at the time,
but it doesn't look like anyone else has commented either and it sounds like
something important, so let's see if we can restart the conversation.

I agree that passing all ModelElements through the API as opaque objects of
type Object is really bad idea since we lose all the power of Java's type
checking, but I'm not sure what issue you're trying to address here.  The
opaque Object style of API is unfortunate, but a design cleanup, while
tempting, seems like less important task than many of the others on our
plate.

Is the main thrust of this proposal to provide a wrapper to hide the
machinery of Undo/Undelete?  If so, perhaps a better name than
ModelElementFacade would be DeletableModelElement or something similar.  It
could provide methods specific to its function like delete, undelete,
isDeleted, deletePermanently or similar types of things.  I think lumping
getName() in with delete() is going to start us down the road of creating a
single huge interface.

Perhaps restating the goals for this new interface would help others provide
more focused feedback.

Tom

> -----Original Message-----
> From: Bob Tarling [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, December 20, 2006 8:16 PM
> To: [email protected]
> Subject: [argouml-dev] ModelElementFacade (again)
> 
> 
> 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]
> 

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

Reply via email to