Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper way to stop New() execution
Message
De
31/10/2006 16:20:20
 
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01165405
Message ID:
01165953
Vues:
14
>If you have 'application' level code you probably shouldn't run that code in in the constructor. A constructor should just bring up the object with as few dependencies as possible. Instead consider creating an Initialize() method or something like that that you can externally to set up your connection etc. You can return true or false from that and you can manage that in your application code more easily.
>
>Throwing exceptions will give you that same functionality but I personally think that object instantiation should always work unless there's truly an exceptional failure.

Ok, thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform