Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design Pattern
Message
De
07/04/2011 01:01:16
 
 
À
06/04/2011 13:31:27
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01506278
Message ID:
01506328
Vues:
48
I'm with Viv ... the delegate approach sounds good to me too.

~~Bonnie



>I'm refactoring some methods which have the pattern:
>
>Do some common stuff
>Do some specific stuff
>Do some more common stuff
>
>Where the "Do some specific stuff" is really instance code implemented as:
>
>Select Case...
>
>or
>
>IF
>Else If
>Else If
>.
>.
>.
>.
>
>Some of these methods are 2000+ lines long :(
>
>I am thinking of passing in a delegate for "Do specific stuff" because I know at design time what needs to be called.
>is this a reasonable approach?
>
>Or
>
>Is a better approach to create methods for
>
>CommonStuff()
>SpecificStuff()
>MoreCommonStuff()
>
>The delegate approach seems cleaner, I just wonder if I am missing something obvious. Any Thoughts?
>
>Thanks
>
>Bruce
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform