General information
Category:
Object Oriented Programming
>>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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only