Re: Consuming your own events.

Sebastien Lambla <[email protected]> Thu, 31 Jan 2008 12:59:34 +0000
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
> In case of framework/library code, I would favor consistency over
> correctness. Maybe your solution has some problems attached to it too.
> When you find out about it, what will happen? A fourth pattern? Being
> that the official guideline and the vast majority of .NET code use the
> OnXXX pattern, I will go that way.

I favour correctness in a new implementation. Just because everybody uses
one method (most of the time in the wrong way) deosn't mean we have to live
with it.
Then again, as long as a pattern is followed accurately and defend itself
against coding practices that tarnished the previous pattern, it will get
adopted. If it has flaws another one will replace it. That's natural
selection, and something software engineers are very much used to.
But maybe that's a conversation for alt.net, not for this list.

> Also, as others have pointed out, most of the time I override the
> OnXXX method is because I want to control the execution order (very
> useful in ASP.NET). It is also useful to patch buggy controls which
> raise events when they should not.

Let's not confuse supporting existing APIs and writing new ones. Your use of
OnXxx on existing frameworks is a given.

> If something smells fishy to me, it's WPF and the hoops it needs to go
> through to raise events. Looks like leaky implementation ...

I fail to see how any of this is fishy. WPF solves problems in a different
way, and the event and DP system is solving a different kind of problems.
Looking leaky and smelling fishy are definitely not how i would describe
this API.

> On a related note, binding, control validation and many other things
> works differently in WPF, Winforms and ASP.NET. Would it be nice that
> we get one "meta" model that can be used in all of them. Sure! Will we
> get that one day? I doubt it.

If you believe in meta models, or even that they can exist, you're living in
a software world that must be very different to mine.

New APIs replace the previous ones to provide more power. WPF Databinding is
significantly more powerful than Winforms one, so naturally it comes with a
different architecture. I don't see any issue in this.

And I fail to see what all those points have to do with the shapeshifting
abilities of the OnXxx anti-pattern.

--
SerialSeb

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com