In order to download this and review it, we need to provide you with
our name and email address and agree to a custom software license
agreement and a non-disclosure agreement??
How can we possibly even discuss it on a public list if we have to
sign an NDA to get access to it?? "Don't tell people who are not bound
by this agreement about what's inside the software."
Have you actually heard of Open Source Software?
So, yes, you're "totally crazy" - and that's without even looking at
the actual idea :)
> It's called Property-Invocation Programming, or "Pi
> Programming" for short. Details can be found at http://www.millionmunkeys.net/PiMunkey/
You're making up a name for a small subset of a more general
event-based programming model. You claim that "you don't have to
register any events" but addListener() and addFilter() are exactly
that: event registration points (especially since you can register a
handler for an event that doesn't match an actual property). I don't
think there's anything particularly novel about the idea at large and
I think the forced mapping of an event-based system onto essentially
fake get/set methods is a fairly warped way to go about event-based
programming.
Since the event registration is per-object and is explicit, any
application needing to create transient domain objects using this
machinery would have to explicitly register all the event handlers
every time an object is created. That would lead to lots of event
registration code scattered throughout the app or to factory objects
that then have to know about all of the event handling logic - both of
which create a terrible tangle of dependencies. AOP is designed to
handle this sort of stuff (and is specifically suited to the example
you give about adding an audit trail to an object). AOP operates at
the class level rather than the object level, removing the problems of
registering event handlers everywhere an object is created.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
Not true. State changes in an application are not restricted to a
variable changing its value - that's too narrow a view.
> The main issue I ran into was where there wasn't an event to listen
> for, and I had no control over the object being watched, or I didn't
> want to modify that code to add a new event.
But your method doesn't let you watch arbitrary objects - they must be
PiComponent instances and therefore you are implicitly modifying "that
code" because you're forcing it to be an instance of your own data
type. AOP allows for arbitrary objects to be wrapped in logic that
could, for example, raise events on setters and getters which could,
in turn, be listened to independently of the object being observed
(which is the goal: to avoid coupling).
> Had extjs used property-invocation, I could have added a listener for
> a currentPage property (which didn't exist, avoiding any overlap with
> existing code) and executed my paging code instead.
See my comment above. You can apply this sort of event model to
existing code without modifying it directly. And you get something
more flexible.
> I'll read up more on AOP and compare.
Cool.