--
You received this message because you are subscribed to the Google
Groups "UML Forum" group.
Public website: www.umlforum.com
To post to this group, send email to umlf...@googlegroups.com
To unsubscribe from this group, send email to
umlforum+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/umlforum?hl=en?hl=en
>
> Personally, I find the notion of an "active object" troubling. It
> seems to me that, if anything, it is a property of how you choose to
> implement an object and not of the object itself.
I suspect you are bothered that the casual definition is that any object
with a state machine is active and state machines specify private object
implementation. But that's just a convenient description because the
translation methodologies, starting with Shlaer-Mellor in the early
'80s, require that all objects with behavior responsibilities must have
a state machine.
So I agree it is somewhat sloppy to link it to object state machines.
However, I think the real intent was simply to identify objects that
have behavior responsibilities (i.e., execute problem space rules and
policies). It is often useful to distinguish between objects that are
just dumb data holders (i.e., have only knowledge responsibilities) and
those that have behaviors. That distinction has nothing to do with
object implementation; it is about the intrinsic nature of the object.
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
Rene Descartes went into a bar. The bartender asked if he would like a drink. Descartes said, "I think not," and disappeared.
H. S. Lahman
H.la...@verizon.net
software blog: http://pathfinderpeople.blogs.com/hslahman/index.html
What situation would call for specializing an active class (one with a separate state machine for each instance) to a passive class?
> When slipping try to find some solid catch. In that case it's that the
> "active" concept has nothing to do with implementation.
For me, the "active" concept is slippery too. Is "Customer" an active
object in a banking system? What about "Account"?
> So the "thread" argument is irrelevant.
OK. You should tell the authors of UML! (Although, to give them their due,
they have attempted to expunge the word "thread" from their definition of
"active". They just haven't quite succeeded yet!)
I once, as a perverse experiment, implemented a real-time simulation of
bank of elevators (including the elevators themselves, the request
buttons, and the algorithms that determined which elevator should respond
to a request at a floor, and a simple graphical display) as a single
monolithic COBOL program. Conceptually, the sofware consisted of around 70
parallel processes, but they were all implemented using a form of
co-routining.
I don't think I could tell you which "objects" in this software were
"active".
Rgds
Ashley
>>> - A is an active class (isActive is true)
>>> - B and C are specializations of A, but are not specified as active
An "ATM" is an "automatic teller machine". Suppose I use a human teller
and the human teller types my request to withdraw money into a keyboard,
is there any "active object"?
Perhaps the active object is now the keyboard? I think the answer must be
yes, as the human teller could just be use keyboard on another ATM under
her desk, and this we think is an active object.
However, I cannot see that "the keyboard" qualifies as an object that (per
the UML specification):
". . . as a direct consequence of its creation, commences to execute its
classifier behavior, and does not cease until either the complete behavior
is executed or the object is terminated by some external object."
However, I can understand that "non-persistent events" are special, in
that such events require immediate dedicated attention or are lost. This
could be true of the key pressses on a keyboard or the events at an ATM.
(And perhaps such events are what you call "not symbolic", as symbols
provide a medium for persisting and therefore for buffering and processing
later.)
But if this really is the nub of the matter I think the epithet "active"
properly belongs to event and not to object, and the definition of
"active" should be quite different from that currently given in UML.
Rgds
Ashley
> I suspect the isActive property was influenced by RUP:
Actually, I believe it predates RUP. In the early '80s the Shlaer-Mellor
methodology for translation recognized that knowledge and behavior
access were quite different (i.e., synchronous vs. asynchronous) and
that would be important for the transformation engine. So 'active' was
used to identify classes that had behavior responsibilities and,
therefore, would require asynchronous messaging infrastructure in the
implementation.
State machines came in because all translation methodologies require an
object with behavior responsibilities to have a state machine. So it
became an idiom to equate 'active' with the object having a state machine.
> First of all, active objects are system ones, i.e symbolic
> representation of business ones.
> Second, only physical objects can interact with the system, so class
> for Accounts is not active.
> Third, interactions are to be real (events), not symbolic (language
> based), so individual customers (corporate ones are not even physical)
> are not, but ATM are.
> There is no problem or ambiguity with active classes. If you need more
> convincing have a look at real-time modelling (eg H. Gomaa).
I don't know where you are getting this, but I have to agree with Ashley
that it is not from UML.
I would add that I don't think it is from OOA/D either because the
notion of 'active' dates back to the early '80s (see my response to
Chaves) and I don't know of any OOA/D methodology that uses it in any
way other than as a class characteristic that may be applied to any
class of objects that have behavior.
I don't know anything about Gomaa, but I do know that other R-T/E
authors I have read -- Mellor, Selig, Douglass, Raistrick -- do not
share your view.
The state machine is something of a red herring. When resolving the requirements and you must abstract objects that have behavior responsibilities (i.e., must execute problem space rules and policies), then you have active objects. If the objects you need to abstract only have knowledge responsibilities, then those objects are passive because they does not do anything; they just know things.
Note that in an OO generalization tree, as soon as you define a property, it applies to all descendants. So as soon as you define a single behavior responsibility for a superclass, that superclass and all descendant subclasses become active.
If there were an OCL constraint stating that class behavior implies an active class, then, because behavior is inherited, all subclasses would also be active. But, there is no such constraint in UML that I've seen.
The state machine is something of a red herring. When resolving the requirements and you must abstract objects that have behavior responsibilities (i.e., must execute problem space rules and policies), then you have active objects. If the objects you need to abstract only have knowledge responsibilities, then those objects are passive because they does not do anything; they just know things.
Note that in an OO generalization tree, as soon as you define a property, it applies to all descendants. So as soon as you define a single behavior responsibility for a superclass, that superclass and all descendant subclasses become active.
When resolving requirements, you must abstract objects that have behavior responsibilities that execute in response to received signals (i.e., must execute problem space rules and policies in response to received signals), then you have active objects. If the objects you need to abstract only have knowledge responsibilities (e.g., accessors and mutators), then those objects are passive because they do not do anything related to problem space rules and policies; they just know things.This rephrasing agrees with the OCL constraint, above and makes sense to me. Would you agree with this rephrasing, HS?
@Lahman, I must confess my reference to "separate state machines for each instance" was not an original thought. Shaler and Mellor said it in the Object Lifecycles book. I suppose you are implying that behavior responsibility does not have to be represented by a state machine, right? Your knack for abstraction cannot be overstated :).
-- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer Rene Descartes went into a bar. The bartender asked if he would like a drink. Descartes said, "I think not," and disappeared. H. S. Lahman
The state machine is something of a red herring. When resolving the requirements and you must abstract objects that have behavior responsibilities (i.e., must execute problem space rules and policies), then you have active objects. If the objects you need to abstract only have knowledge responsibilities, then those objects are passive because they does not do anything; they just know things.
Note that in an OO generalization tree, as soon as you define a property, it applies to all descendants. So as soon as you define a single behavior responsibility for a superclass, that superclass and all descendant subclasses become active.
I don't see any OCL constraint in UML that states that having behavior in a class implies isActive is true, nor one that states that isActive in a superclass implies isActive in a child class.
> Active classes offer a good example of UML benefits and limits, namely
> introducing a warranted concept with a half baked definition like "a
> class characteristic that may be applied to any class of objects that
> have behavior".
> The point is, how to decide ?
The notion of 'active' was introduced because it has implications for
the implementation of the model. If an object has no behavior
responsibilities, then the implementation can always provide synchronous
collaborations safely. However, if it has any behavior responsibilities,
then the implementer may have safety issues with a synchronous
implementation. IOW, there is nothing to decide; one can think of
'active' as simply a flag to the model implementer that there may be
safety issues for the implementation of collaborations with the object.
Note that in the translation approaches 'active' is not even in the MDA
profile. That is because it is redundant. In those approaches all
objects with behavior responsibilities must have a state machine. That
means that all behavior collaborations in the model are event-based so
the model already employs asynchronous behavior collaborations. Since
asynchronous communications are the most general, one is guaranteed the
model can always be implemented safely and there is no need to warn the
implementer.
--
Life is the only flaw in an otherwise perfect nonexistence
-- Schopenhauer
Rene Descartes went into a bar. The bartender asked if he would like a drink. Descartes said, "I think not," and disappeared.
H. S. Lahman
The state machine is something of a red herring. When resolving the requirements and you must abstract objects that have behavior responsibilities (i.e., must execute problem space rules and policies), then you have active objects. If the objects you need to abstract only have knowledge responsibilities, then those objects are passive because they does not do anything; they just know things.
Note that in an OO generalization tree, as soon as you define a property, it applies to all descendants. So as soon as you define a single behavior responsibility for a superclass, that superclass and all descendant subclasses become active.
I believe "a class with behavior responsibilities" can mean multiple things, such as "a class that has methods" or "a class that has classifier behavior". I originally interpreted what he wrote as, "a class that has methods must be an active class", which is obviously false. Given the Executable UML context of his book, where problem domain classes run state machines that invoke behaviors in response to signals, I can see an interpretation that makes his statements true. I interpret what he wrote as follows (with my clarifications in italics):
When resolving requirements, you must abstract objects that have behavior responsibilities that execute in response to received signals (i.e., must execute problem space rules and policies in response to received signals), then you have active objects. If the objects you need to abstract only have knowledge responsibilities (e.g., accessors and mutators), then those objects are passive because they do not do anything related to problem space rules and policies; they just know things.This rephrasing agrees with the OCL constraint, above and makes sense to me. Would you agree with this rephrasing, HS?
Alas, the quotes hit a Hot Button for me that is mostly OT...
> First... the idea of objects that have life histories or life cycles
> dates back to Michael Jackson
> in 1975...
Right. Jackson was far ahead of his time. JSD was may favorite design
methodology in the '70s but I didn't really understand why until the
early '80s. I recall a comparison of models produced by different
structured methodologies. All of them looked pretty much the same except
the JSD design, which was quite different. With 20/20 hindsight I would
describe it as being very OOA-like. However, Jackson himself saw it as a
Structured methodology (i.e., the S in JSD), but it sure had an OO-like
approach.
OTOH, it has been many moons, but I don't recall Jackson using 'active'
in the sense we use it in OOA/D.
>
> I went back to the UML2.0 specification...
> ---------------
> An active object is an object that, as a direct consequence of its
> creation, commences to execute its classifier behavior,
> and does not cease until either the complete behavior is executed or
> the object is terminated by some external object.
> (This is sometimes referred to as �the object having its own thread of
> control�.) The points at which an active object
> responds to communications from other objects is determined solely by
> the behavior of the active object and not by the
> invoking object. If the classifier behavior of an active object
> completes, the object is terminated.
This I find very disturbing. OMG has completely changed the sense of
what 'active' means from the original UML. Here OMG seems to defining an
ongoing action like a polling loop. It also ties the execution of the
behavior to the life of the owning object. BUT...
You will note that in Superstructure 6.2.1 they indirectly describe
'active objects' in the original sense of entities having behavior
responsibilities. So how does OMG reconcile these two views? With the
idea that all behaviors are objects! So the paragraph you quote is
talking about a "behavior object", not an OO object with behaviors. This
is the sort of nonsense that happens when you try to reconcile
incompatible subject matters in a single notation.
FWIW, this is the furthest I have seen OMG go down the garden path. To
me the notion that behaviors are objects is beyond the pale of ludicrous
in an OOA/D context. It is clear OMG is also trying to support
functional programming in UML where functions are first class objects.
But that ignores the fact that the OO and FP paradigms are fundamentally
incompatible and antithetical. IOW, there is no way to reconcile them
under the same notation semantics.
> generalization
> A taxonomic relationship between a more general classifier and a more
> specific classifier. Each instance of the
> specific classifier is also an indirect instance of the general
> classifier. Thus, the specific classifier indirectly has
> features of the more general classifier. See: inheritance.
This is an example of OMG being forced to dumb down the semantics of
notation elements to support disparate subject matters. To provide the
necessary generality to accommodate all subject matters, they must
generalize the semantics to the point that there is almost no
information content. So to interpret the model correctly you have to go
get an OOA/D book that explains that what this is really about is sets,
subsets, and Venn Diagrams. Grrrr.
>
> inheritance
> The mechanism by which more specific elements incorporate structure
> and behavior of more general elements.
And this is just plain wrong in an OOA/D context because one can inherit
knowledge as well as behavior.
All of these things are typical of what I have seen many times since
v2.0.0. People seem to be going into the UML specification and "fixing"
it so it supports some new modeling context OMG would like to support.
But as they do that they either directly break the original OOA/D
semantics or they dumb down the semantics into obscurity so that we have
threads like this one on forums.
>
> ----------------
> SO I think that any specialized class will also, automatically,
> active... but it can change the inherited behaviors.
While I agree that's true, I don't think OMG is going to get any awards
for clarity. B-)