Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Event naming convention confusion
Message
De
22/06/2007 16:07:24
 
 
À
22/06/2007 09:15:43
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01234534
Message ID:
01235100
Vues:
20
>I guess I didn't state it well, but Juval was the one using the "OnCustomerChanged" as a handler method.

I guess I misunderstood, sorry. Odd that he would adopt that naming convention. It's just not very intuitive at all, IMHO. I take back what I said about him knowing his stuff!!! <bg>

~~Bonnie



>Hi Bonnie,
>
>I guess I didn't state it well, but Juval was the one using the "OnCustomerChanged" as a handler method. It surprised me as I have other stuff of his that I think is pretty good. Content wise I anticipate this one to be good also.
>
>Tim
>
>>
>>>I keep several books for reference usually specialty stuff like Networking, graphics, or Design patterns. Currently I am looking at "Programming .Net Components" by Juval Lowy and O'Reily book. He uses the convention you mention below.
>>
>>Yeah, I've heard that Juval Lowy really knows his stuff.
>>
>>>Thanks for the confidence in my convention. It seemed right to me.
>>
>>Yep. Me too! =0)
>>
>>~~Bonnie
>>
>>
>>
>>
>>
>>>Bonnie,
>>>
>>>>Wow, guess you've been reading the wrong books! <g> It's been awhile since I've read many .NET books (I did a bit more reading when I was learning it back in 2002, and I had a hard time finding good books back then).
>>>
>>>I keep several books for reference usually specialty stuff like Networking, graphics, or Design patterns. Currently I am looking at "Programming .Net Components" by Juval Lowy and O'Reily book. He uses the convention you mention below. One of the Networking with Dot Net books uses the other example I quoted. Definately makes it harder to keep track of what you are reading as you go through it.
>>>
>>>>
>>>>You're not on the wrong track, at least not IMHO. We have used the same naming conventions as the ones you are using. I can't imagine using "public void OnCustomerChanged()" as the handler method at the subscriber!! I can see how that would be terribly confusing!!
>>>>
>>>
>>>Thanks for the confidence in my convention. It seemed right to me.
>>>
>>>Tim
>>>
>>>>
>>>>
>>>>
>>>>>I find it important to stick to a reasonable naming convention and try to do this with my code. I am using a what I thought was consistent with Microsoft regarding events such as
>>>>>
>>>>>// the event
>>>>>public event CustomerChangedDelegate CustomerChanged
>>>>>
>>>>>// Event args
>>>>>public class CustomerChangedEventArgs : EventArgs
>>>>>
>>>>>// the method that raises the event (In the publisher)
>>>>>public void OnCustomerChanged()
>>>>>
>>>>>// The method for the handler (at the subscriber)
>>>>>public void CustomerChangedHandler()
>>>>>
>>>>>Why then with every book I look at are these same names being used but differently such as
>>>>>public void OnCustomerChanged() used as the handler method at the subscriber. or
>>>>>public event CustomerChanged OnCustomerChanged when creating the event
>>>>>
>>>>>This is terribly confusing. Am I on the wrong track or do so many authors struggle to understand the convention? What are y'all doing with your event nameing?
>>>>>
>>>>>Tim
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform