Am 10/23/12 9:24 PM, schrieb Thomas Schmidt:> Hi,
>
> how do Obj-C Categories and Extensions map to UML standard constructs?
>
> F.e. Obj-C interfaces could be thought of as UML classes and Obj-C
> protocols may map to UML interfaces. But what's the matter with class
> extending constructs?
>
> Thomas
Well, that does not map so easily to UML. Categories are nothing else
but a bunch of ordinary functions that got added to Objective-C's type
reflection system, you'll have a hard time to model them with UML
because UML is IMHO not intended to accommodate ordinary functions.
Under UML everything must be an object.
From another point of view, you could model a category simply as part
of an objectiveC class, since category/class extension methods are
intended to be part of the class (from a users point of view there
should be no observable difference between a method that is part of a
class and a method that got added to a class through a category or class
extension).
So from that point of view, categories and class extensions are not
first class citizens of UML. Instead of being UML entities in their own
right, their payload simply gets added to the extended class.
Regards,
Stuart