Topic: C++Beans
Author: Edward Diener <eddielee@abraxis.com>
Date: 1999/05/11 Raw View
Max Polk wrote:
> There is no such thing as a "property" in a class in Java, but this has
> by convention been used, especially with JavaBeans, to signify a data
> member and associated methods to get and set that data member.
>
> Is there a movement to introduce "standard" conventions like properties,
> events, and listeners, or is such a thing not needed or necessary?
There was a discussion in this forum a while back about properties and
closures as implemented by Borland in C++ Builder. C++ Builder uses these
extensions to the C++ language to provide properties and events to the C++
Builder programming environment. While the event model in C++ Builder does
not emulate events and listeners as in Java, the event model in C++ Builder
is extremely easy to use and well designed. The property model also is well
designed and is closer to the JavaBeans property model. You might want to
take a look at these implementations to get some idea of the sort of
additions to C++ you might like to see.
I find that the concept of a closure in C++ Builder, which it uses to
implement events, would be an extremely useful addition to the C++ language
even without its connection to events. A C++ Builder closure is a pointer to
a member function of a particular prototype that can be assigned to a member
function of any object that matches that prototype. I find no reason why this
"type" can not be added to the C++ language, other than implementation
details. Since Borland has already implemented this pretty cleanly, they can
be looked as a starting point for this addition to the language. Borland's
implementation of properties in C++ Builder, also done very cleanly and
simply, using the extension __property keyword, can also be seen as a
starting point for adding properties to the language.
I am not saying the Borland's implementation of these ideas in C++ Builder is
the only way that adding general "property" and "event" ideas to the language
but that they exist as prior art and should be considered if and when these
additions are made to C++.
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: sirwillard@my-dejanews.com
Date: 1999/05/10 Raw View
In article <MPG.119e10238f4c08539896bd@news.mindspring.com>,
none@none.invalid (Max Polk) wrote:
>
> There is no such thing as a "property" in a class in Java, but this has
> by convention been used, especially with JavaBeans, to signify a data
> member and associated methods to get and set that data member.
>
> Is there a movement to introduce "standard" conventions like properties,
> events, and listeners, or is such a thing not needed or necessary?
>
> How one class interacts with another is left up to the programmer, yet
> things like properties, events, and listeners in JavaBeans have been used
> to add a whole new level of usefulness to the Java programming language,
> in fact, a component architecture (JavaBeans).
>
> Even with C++'s templates and operator overloading, I don't see such a
> "higher level". The usefulness of the containers library and other
> libraries cannot be diminished, but is there a need for a component
> architecture for C++ (and please don't say "COM"!) by which we can bring
> together component writers to a standard of communication, self-discovery
> of properties and events, serialization (persistance)?
Ok, I won't say "COM". "Corba".
It has the same drawbacks as COM, but it's a different answer, and maybe it
will show you why we aren't talking about adding such facilities to the
language standard. Component architectures are quite doable in C++ as is.
The exact implementation is either library or platform dependant, but so
what? It's the same concept as why graphics aren't included in the C++
language. Remember that JavaBeans aren't part of Java the language. They are
just a library extension that's standardized. COM and Corba fit the exact
same bill here.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: none@none.invalid (Max Polk)
Date: 1999/05/08 Raw View
There is no such thing as a "property" in a class in Java, but this has
by convention been used, especially with JavaBeans, to signify a data
member and associated methods to get and set that data member.
Is there a movement to introduce "standard" conventions like properties,
events, and listeners, or is such a thing not needed or necessary?
How one class interacts with another is left up to the programmer, yet
things like properties, events, and listeners in JavaBeans have been used
to add a whole new level of usefulness to the Java programming language,
in fact, a component architecture (JavaBeans).
Even with C++'s templates and operator overloading, I don't see such a
"higher level". The usefulness of the containers library and other
libraries cannot be diminished, but is there a need for a component
architecture for C++ (and please don't say "COM"!) by which we can bring
together component writers to a standard of communication, self-discovery
of properties and events, serialization (persistance)?
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]