Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Encapsulation and enviroment
Message
De
27/06/1999 13:13:14
 
 
À
27/06/1999 12:48:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00234491
Message ID:
00234517
Vues:
24
>>Dear All!
>>
>>I am on rewrite my semi-OO application to meet the closest criteria of OOP.
>>
>>My first big problem I faced, how to give the info to my BusinessObjects about envirometal data (e.g.: path of database files, ... etc.)
>>
>>I identified two main algorythm:
>>passing the an object parameter to init method
>>creating the enviroment object internally
>>
>>Which one fits best into the world of OOP?
>
>Business objects in most frameworks either search for these properties in an application object, or in the parent form, which probably got them originally from an application object. Only if the object is not contained and the application object cannot be found, it should take on a set of defaults, or instanciate an application object that knows how to establish defaults.

Dear Erik!

My app used the first way you mentioned. My objects used the properties of main application object. I thought it is not compatible with Encapsulation because an object is depending on an other object. (Business objects are depending on application object.) I had only one public variable (goApp) and all object used it. I am afraid to use referencing the app object via object property because of possible refrence dagling. (i.e. pass a refrence for the App object and save it into a property variable in a Business object). So I thought to create an enviroment object internally or pass it as parameter and save its properties into object properties of Business object.

BB
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform