--
Keith Hutchison
http://balance-infosystems.com http://realopen.org
Context:
1. Given a UML class diagram, which will be automatically converted
into a RealBasic class.
2. Given a RealBasic class, which is automatically converted to a UML
class diagram.
The latter could be part of the Ultimate Documentation Plugin which
would simply export all the classes, their methods and attributes in a
simple HTML table format so that it would be easy to fill in the
descriptions later and documentation is ready. Now there's a task for
the next summer holiday...
//timo
That said, a RealBasic event is no different from a class method really in
terms of its structures, method, content etc. The only thing that is
different about it is the semantics of when it gets called based on
(frequently asynchronous) flow of control.
On 1/10/06 1:36 AM, "Keith Hutchison" <keith.kjtl...@gmail.com>
wrote:
>
> That said, a RealBasic event is no different from a class method really in
> terms of its structures, method, content etc. The only thing that is
> different about it is the semantics of when it gets called based on
> (frequently asynchronous) flow of control.
>
Where it's substantially different is in terms of instances.
Each instances _can_ override what happens in an event.
The only way I can currently think of showing this in UML is to have
each instance that is contained by say a window, is to make each
instance of a class with events a subclass.
Currently I am using _() as an separator. An alternative is _events()
... _methods() ... .
Another is using _ as a prefix or a suffix ( or _event_ )
What you would expect to see if you asked someone else to document
your code for you, within UML.
On 1/10/06 2:22 PM, "Keith Hutchison" <keith.kjtl...@gmail.com>
wrote:
>
> On 1/11/06, Ed Kleban <E...@kleban.com> wrote:
>>
>> I'm not particularly up on UML. I do know of the QuickUML product that is
>> written in RealBasic for it's Mac version, and I do know they have plans to
>> create a RB code generator for it.
> Last time I asked, there were no plans for a RB code Generator.
I asked within the last few days. There are plans or desire at least, there
is not a date.
>>
>> That said, a RealBasic event is no different from a class method really in
>> terms of its structures, method, content etc. The only thing that is
>> different about it is the semantics of when it gets called based on
>> (frequently asynchronous) flow of control.
>>
> Where it's substantially different is in terms of instances.
> Each instances _can_ override what happens in an event.
>
Uh, I don't think so... At least not using standard OO terminology.
Creating a new Window in the IDE through use of "Add Window" does not create
a new instance of anything. It creates what is essentially a new class. In
fact if you look at the third property in the Project tab you'll see it
claims that "Window" is its super class.
When you add a control to a Window, it is a directive to instantiate a
control of a given class and put it in the Window when that window gets
instantiated at run time. Similarly adding an event to a window or control
is essentially adding a new method for that control or window in the context
of one or more Window instances you instantiate at runtime for the
particular new Window subclass you're building.
As such, events which are essentially methods that are part of a given
window class but not defined necessarily in the "methods" section, are
similar to an orphaned method defined with "Extends" that also provides
access to that method for all instances created of the class that the method
is "virtually" added to.
So the difficulty in how to show this UML I think isn't that there is
something strange going on in a per-instance aspect, because nothing is.
The trickiness is that in terms of declarations the event methods added to
the class are may be divorced from the (Window) class declaration in a
manner similar to the way that the declaration for required methods that
must be implemented for a class that supports a given Class Interface are
defined somewhere else other than visible in the Class methods.
I don't know that I'd stand 100% behind the text I've written above to
explain this well and accurately. It's a messy concept I probably didn't do
perfect justice to. But my main point is that thinking of event methods as
"instance methods" is not correct in my opinion. "Instance method" means
something, and event handlers are instance methods in that all instance of a
given class will implement a common piece of code for that method."
"Per-instance methods" of the kind you imply means something... something
that RB does not implement. Class methods are something we can't talk about
here (yet) because this isn't the beta list. Event Handlers are simply
special instance methods which get called in a different manner than
standard instance methods.
Interpreting from what is shown in the debugger
Each event with code shows up as a window method.
eg
WindowMultiMedia.PopupMenuMixers1_change is what is shown in the top
left hand window when I put the following code in
sub change()
dim stop as Boolean
stop = true // <- break
end sub
Keith
The difficulty comes from the fact that including five instances of the same
control in the window, either at design time by draging them into the IDE,
or at runtime by instantiating or cloning controls and making the window or
one of its controls be the declared parent, is changing the set of instance
methods declared for that particular Window subclass, as surely if they
happened to be added to the list of standard methods -- which is another
feature not supported by RB.
Yes, this complicates how the heck you show this in UML because UML is (I'm
making a total wild shot in the dark here) a language for describing a
static program structure, not one that is dynamically configurable at
runtime or IDE drag time. If you want to convert an RB project to UML,
that shouldn't be hard at all -- IF you doing it on a static version of the
code that declared to the IDE. If your doing it for dynamic code then
presumably that code itself could conceivably assit you in generating UML
because it does have access to the list of the controls that exist for any
given window at any point in time. But you would have to augment this with
knowledge that is only avaiable in the source code and at compile time, such
as a comprehensive list of which events are defined for which controls.
Endaevaoring to go the other direction, creating a program from a UML
structure is going to be darn tough if that structure is dynamic rather than
static. I don't have any suggestions on how you can do that any more than I
can tell someone who want to create a database with dynamic structure how to
document a static view of it that will remain accurate. That's the purpose
of the database schema -- to allow just such programs to be written.
Unfortunately, unlike Smalltalk, the compiler throws the schema away in RB
so that there is no access to it at runtime.
On 1/10/06 2:59 PM, "Keith Hutchison" <keith.kjtl...@gmail.com>
wrote:
>
> So the difficulty in how to show this UML I think isn't that there is
> something strange going on in a per-instance aspect, because nothing is.
> The trickiness is that in terms of declarations the event methods added to
> the class are may be divorced from the (Window) class declaration in a
> manner similar to the way that the declaration for required methods that
> must be implemented for a class that supports a given Class Interface are
> defined somewhere else other than visible in the Class methods.
>
> I don't know that I'd stand 100% behind the text I've written above to
> explain this well and accurately. It's a messy concept I probably didn't do
> perfect justice to. But my main point is that thinking of event methods as
> "instance methods" is not correct in my opinion. "Instance method" means
> something, and event handlers are instance methods in that all instance of a
> given class will implement a common piece of code for that method."
> "Per-instance methods" of the kind you imply means something... something
> that RB does not implement. Class methods are something we can't talk about
> here (yet) because this isn't the beta list. Event Handlers are simply
> special instance methods which get called in a different manner than
> standard instance methods.
Each 'event' that is associated with a control ends up being a method
on the window instance. Which is entirely different :-)
The following is a class diagram I'm working on, I've set each event
to an unspecified scope which I'm happy with. I've also set each event
to be a Event stereotype but this information fails to show up on the
HTML report produce by Visual Paradigm.
The class in the following diagram with the unspecified scope for
events is the Canvas class.
http://balance-infosystems.com/documentation/multimedia/
On 1/10/06 3:34 PM, "Keith Hutchison" <keith.kjtl...@gmail.com>
wrote:
>
> Hi Ed,
>
>> So the difficulty in how to show this UML I think isn't that there is
>> something strange going on in a per-instance aspect, because nothing is.
>> The trickiness is that in terms of declarations the event methods added to
>> the class are may be divorced from the (Window) class declaration in a
>> manner similar to the way that the declaration for required methods that
>> must be implemented for a class that supports a given Class Interface are
>> defined somewhere else other than visible in the Class methods.
>>
>> I don't know that I'd stand 100% behind the text I've written above to
>> explain this well and accurately. It's a messy concept I probably didn't do
>> perfect justice to. But my main point is that thinking of event methods as
>> "instance methods" is not correct in my opinion. "Instance method" means
>> something, and event handlers are instance methods in that all instance of a
>> given class will implement a common piece of code for that method."
>> "Per-instance methods" of the kind you imply means something... something
>> that RB does not implement. Class methods are something we can't talk about
>> here (yet) because this isn't the beta list. Event Handlers are simply
>> special instance methods which get called in a different manner than
>> standard instance methods.
> Each 'event' that is associated with a control ends up being a method
> on the window instance. Which is entirely different :-)
No, each event that is associated with a control ends up being an instance
method defined for the window subclass, and as such will be uniformly called
for any runtime window instance that receives the event handler message that
invokes that method.
Which may or may not be what you meant or were trying to say, but I believe
is a meaningful and accurate statement at least for RB using classic OO
terminology.
> The following is a class diagram I'm working on, I've set each event
> to an unspecified scope which I'm happy with. I've also set each event
> to be a Event stereotype but this information fails to show up on the
> HTML report produce by Visual Paradigm.
>
> The class in the following diagram with the unspecified scope for
> events is the Canvas class.
>
> http://balance-infosystems.com/documentation/multimedia/
Pretty picture :-)
Know what other tools besides Visual Paradigm and QuickUML that others might
be using out there to do designs such as this prior coding in RB?
> > Each 'event' that is associated with a control ends up being a method
> > on the window instance. Which is entirely different :-)
>
> No, each event that is associated with a control ends up being an instance
> method defined for the window subclass, and as such will be uniformly called
> for any runtime window instance that receives the event handler message that
> invokes that method.
I think we are discussing syntax vs concepts.
Conceptually, UML allows code generation. If there is a different
method, ala code within an event, and the target is say java, then I'd
subclass the object when it was placed within a container. In any
event (no pun intended) a method is _not_ an event.
If code is generated from a uml document (actually xmi) then to output
RB code some agreed way has to be in place to be able to distguish
between an event, and a method.
>
> Which may or may not be what you meant or were trying to say, but I believe
> is a meaningful and accurate statement at least for RB using classic OO
> terminology.
>
> > The following is a class diagram I'm working on, I've set each event
> > to an unspecified scope which I'm happy with. I've also set each event
> > to be a Event stereotype but this information fails to show up on the
> > HTML report produce by Visual Paradigm.
> >
> > The class in the following diagram with the unspecified scope for
> > events is the Canvas class.
> >
> > http://balance-infosystems.com/documentation/multimedia/
>
>
> Pretty picture :-)
Thanks :-) I thought I'd better have a clear idea of what I am going
to write before writing an xmi convertor based on Thomas's Project
tool. I'ved decide to run with an unspecified scope for an event
(method), which fits neatly with the RB IDE since events have no scope
and are by default private.
>
> Know what other tools besides Visual Paradigm and QuickUML that others might
> be using out there to do designs such as this prior coding in RB?
Poseidon.
http://www.gentleware.com/
Poseidon has better code generation than Visual Paradigm, and is
generally cheaper, ie, you'll find similiar features of Poseidon
within Visual Paradigm at the next price point.
I find Visual Paradigm easier to use, and Poseidon easier to generate code.
On 1/10/06 5:02 PM, "Keith Hutchison" <keith.kjtl...@gmail.com>
wrote:
>
> Hi Ed,
>
>>> Each 'event' that is associated with a control ends up being a method
>>> on the window instance. Which is entirely different :-)
>>
>> No, each event that is associated with a control ends up being an instance
>> method defined for the window subclass, and as such will be uniformly called
>> for any runtime window instance that receives the event handler message that
>> invokes that method.
>
> I think we are discussing syntax vs concepts.
Problems such as these usually always come down to symantics. I just happen
to be very picky ;-)
> Conceptually, UML allows code generation.
Which sounds cool.
> If there is a different
> method, ala code within an event, and the target is say java, then I'd
> subclass the object when it was placed within a container.
Uh, sorry I don't understand the last line of this paragraph at all, nor how
it relates to the two lines preceding it.
> In any
> event (no pun intended) a method is _not_ an event.
agreed. Methods are not events. Events are not methods.
> If code is generated from a uml document (actually xmi) then to output
> RB code some agreed way has to be in place to be able to distguish
> between an event, and a method.
Yes, definitely. They are different. They have different symantics. And
the mechanism supported by RB for events is different from any other I've
ever encountered. If UML has a set of conventions for classic object
oriented languages, it won't surprise me at all if it simply has neither a
way to diagrammatically show nor in XML-tags to textually represent the
concept of RB Events -- which are just a strange new kind of thing that RS
has added to what is otherwise a pretty vanilla object-oriented language.
>> Which may or may not be what you meant or were trying to say, but I believe
>> is a meaningful and accurate statement at least for RB using classic OO
>> terminology.
>
>>
>>> The following is a class diagram I'm working on, I've set each event
>>> to an unspecified scope which I'm happy with. I've also set each event
>>> to be a Event stereotype but this information fails to show up on the
>>> HTML report produce by Visual Paradigm.
>>>
>>> The class in the following diagram with the unspecified scope for
>>> events is the Canvas class.
>>>
>>> http://balance-infosystems.com/documentation/multimedia/
>>
>>
>> Pretty picture :-)
>
> Thanks :-) I thought I'd better have a clear idea of what I am going
> to write before writing an xmi convertor based on Thomas's Project
> tool.
Sounds like a great idea. I don't know or use UML, but I do use what I
guess I could dub EdML diagrams to design and keep track of my
implementation while coding.
So what exactly are you writing? A UML to RB code generator?
> I'ved decide to run with an unspecified scope for an event
> (method), which fits neatly with the RB IDE since events have no scope
> and are by default private.
Events certainly do have scope -- all executable statements have scope. In
fact to state that they are "private" is to make a statement regarding their
scope -- or to be precise, about the scope of any variables referenced
within the code that they contain.
And is so often the case for events, they have a very special screwy scope
-- as evidenced by the fact that term "me" refers to a specific control in
the context of an event method, whereas it refers to "self" outside of that
context. I don't know if "scope" is even the correct term for this
particular dynamic context. In fact the more I think about it I'm not sure
how to even describe the scope of events, I'd have to give it some more
thought. But I digress.
>> Know what other tools besides Visual Paradigm and QuickUML that others might
>> be using out there to do designs such as this prior coding in RB?
>
> Poseidon.
> http://www.gentleware.com/
>
> Poseidon has better code generation than Visual Paradigm, and is
> generally cheaper, ie, you'll find similiar features of Poseidon
> within Visual Paradigm at the next price point.
>
> I find Visual Paradigm easier to use, and Poseidon easier to generate code.
>
Thanks! Useful tidbits to add to the litany I'm preparing for my
presentation. So far though, as far as we know, none of these critters
generate code for RB yet, right?
You planning on attending Real world?
>
> > If there is a different
> > method, ala code within an event, and the target is say java, then I'd
> > subclass the object when it was placed within a container.
>
> Uh, sorry I don't understand the last line of this paragraph at all, nor how
> it relates to the two lines preceding it.
>
My use of syntax may be misleading/wrong. However the concept is for
'code' to exist within a uml document, it must actually be assigned
somewhere.
The first choice I would have is to have a uml class that mapped to
the control on a window, and place the code there. So in java/c++
terms, it would end up being a subclass.
> >>
> >> Pretty picture :-)
> >
> > Thanks :-) I thought I'd better have a clear idea of what I am going
> > to write before writing an xmi convertor based on Thomas's Project
> > tool.
>
> Sounds like a great idea. I don't know or use UML, but I do use what I
> guess I could dub EdML diagrams to design and keep track of my
> implementation while coding.
>
> So what exactly are you writing? A UML to RB code generator?
I am actually writing a RB to xmi generator that can be imported to
uml programs.
From that I am expecting eventually to be able to export java and c++ code.
Next after that would be a xmi to rb convertor.
> And is so often the case for events, they have a very special screwy scope
> -- as evidenced by the fact that term "me" refers to a specific control in
> the context of an event method, whereas it refers to "self" outside of that
> context. I don't know if "scope" is even the correct term for this
> particular dynamic context. In fact the more I think about it I'm not sure
> how to even describe the scope of events, I'd have to give it some more
> thought. But I digress.
events, even within custom classes, are private ... :-)
>
>
> >> Know what other tools besides Visual Paradigm and QuickUML that others might
> >> be using out there to do designs such as this prior coding in RB?
> >
> > Poseidon.
> > http://www.gentleware.com/
> >
> > Poseidon has better code generation than Visual Paradigm, and is
> > generally cheaper, ie, you'll find similiar features of Poseidon
> > within Visual Paradigm at the next price point.
> >
> > I find Visual Paradigm easier to use, and Poseidon easier to generate code.
By easier to generate code I actually mean you can generate code from
Poseidon at a much lower price point. ie You are able to generate java
code from the Community Edition
> >
>
> Thanks! Useful tidbits to add to the litany I'm preparing for my
> presentation. So far though, as far as we know, none of these critters
> generate code for RB yet, right?
>
> You planning on attending Real world?
Not this year. I am hoping the events/sessions get taped as in what
happens on the screens/displays and audio.
In future years I am also hoping for a Europe Real World conference.
It will be much easier to excite my wife about a trip to the EU than
the US ;-)
On 1/10/06 8:14 PM, "Keith Hutchison" <keith.kjtl...@gmail.com>
wrote:
> My use of syntax may be misleading/wrong. However the concept is for
> 'code' to exist within a uml document, it must actually be assigned
> somewhere.
Yes. I think I understand the goal of what you're trying to achieve.
>> So what exactly are you writing? A UML to RB code generator?
> I am actually writing a RB to xmi generator that can be imported to
> uml programs.
> From that I am expecting eventually to be able to export java and c++ code.
> Next after that would be a xmi to rb convertor.
Sounds like fun stuff!
>> And is so often the case for events, they have a very special screwy scope
>> -- as evidenced by the fact that term "me" refers to a specific control in
>> the context of an event method, whereas it refers to "self" outside of that
>> context. I don't know if "scope" is even the correct term for this
>> particular dynamic context. In fact the more I think about it I'm not sure
>> how to even describe the scope of events, I'd have to give it some more
>> thought. But I digress.
> events, even within custom classes, are private ... :-)
Yes
>>> I find Visual Paradigm easier to use, and Poseidon easier to generate code.
>
> By easier to generate code I actually mean you can generate code from
> Poseidon at a much lower price point. ie You are able to generate java
> code from the Community Edition
Ah.
>>>
>>
>> Thanks! Useful tidbits to add to the litany I'm preparing for my
>> presentation. So far though, as far as we know, none of these critters
>> generate code for RB yet, right?
>>
>> You planning on attending Real world?
>
> Not this year. I am hoping the events/sessions get taped as in what
> happens on the screens/displays and audio.
Well, I know there's going to be a CD with the presentations... or at least
a version of the presentations submitted a month before the conference. I
don't know if they are planning to tapes sessions or not. Have they done
that before? I was there the first year, but not last year.
> In future years I am also hoping for a Europe Real World conference.
> It will be much easier to excite my wife about a trip to the EU than
> the US ;-)
Not very likely. They've had about 125 attendees the last couple of years,
and they certainly don't do it to make money at it. They're lucky if they
break even.
Where do you live?
Here is my latest attempt
http://balance-infosystems.com/documentation/windows/html/win32/
> > events, even within custom classes, are private ... :-)
>
> Yes
I've realised that only instances (objects) events are private, and
that class objects are protected. (In the sense that of thinking that
a class and it's subclassed objects are a package )
> Well, I know there's going to be a CD with the presentations... or at least
> a version of the presentations submitted a month before the conference. I
> don't know if they are planning to tapes sessions or not. Have they done
> that before?
No. Taping the event makes sense to me :-)
> > In future years I am also hoping for a Europe Real World conference.
> > It will be much easier to excite my wife about a trip to the EU than
> > the US ;-)
>
> Not very likely. They've had about 125 attendees the last couple of years,
> and they certainly don't do it to make money at it. They're lucky if they
> break even.
I wonder how many more people they would get if the event was staged in Europe.
>
> Where do you live?
Australia.