From: Chad B. <chd...@ya...> - 2005-01-14 14:54:49
|
-----Original Message----- From: Chad Brandon [mailto:chd...@ya...]=20 Sent: Friday, January 14, 2005 7:34 AM To: 'wou...@co...' Cc: 'm.m...@co...'; 'and...@li...' Subject: RE: [Andromda-user] UML 2.0 Metafacade? (~ bpm4struts) -----Original Message----- From: and...@li... [mailto:and...@li...] On Behalf Of Wouter = Zoons Sent: Friday, January 14, 2005 4:44 AM To: Chad Brandon Cc: m.m...@co...; and...@li... Subject: RE: [Andromda-user] UML 2.0 Metafacade? (~ bpm4struts) > OCL constraints won't do any good here because we have an association = from > the activity graph to the StrutsController fa=E7ade in the bpm = metamodel, > when calling the .controller feature it is being casted to > StrutsController > without actually performing a check > > [CB] Actually your getController() method can check whether or not its = an > instance of StrutsController and set the controller to null if it = isn't > (if > you look at the implementation of the getController() operation in > StrutsActivityGraphLogicImpl you'll see we actually do this ) so its > impossible to get a class cast like you describe below. The class = cast > was > actually occurring in the UMLMetafacadeUtils#getTagPresent operation. = I > fixed it and Mark's model worked fine but had another validation error > saying he needed the controller (so it looks like you do have a = constraint > for this). > > so you propose we test types each time ourselves in the handleXXX() = method ? isn't that error prone ? [CB] It's currently the best option and it works :) So I would say its = much better than class cast exceptions. [CB] By the way: I wasn't "proposing" we do this check manually each = time. I was simply stating the fact that the class cast was impossible as you described it for that current situation. We could add a check to the metafacade Logic class that checked if the class was assignable to the expected class and if not return null (not sure if performance would be affected much, I can experiment). -- Wouter ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Andromda-user mailing list And...@li... https://lists.sourceforge.net/lists/listinfo/andromda-user |