Guest_imported
New member
- Jan 1, 1970
- 0
I want to know what the ‘best of practices’ as to what and how objects attributes are initiation and population.
Let use the example of a CAR as we ALL know what one is.
Option #1
Instantiate an instance of the car object….
Dim oCar as New Car
Fetch the one I want..
oCar.Fetch (83726)
Should car ID number 83726 not exist I still have an EMPTY car object.
Option #2.
Instantiate the application server.
Dim oAppServer as New AppServer
Instantiate an instance of the car object….
Dim oCar as Car
Fetch the one I want..
oCar = oAppServer.FetchCar (83726)
Should car ID number 83726 not exist the car object is = Nothing.
And how about a collection of cars
oCar = oAppServer.FetchCars (RED)
Your comments?
Let use the example of a CAR as we ALL know what one is.
Option #1
Instantiate an instance of the car object….
Dim oCar as New Car
Fetch the one I want..
oCar.Fetch (83726)
Should car ID number 83726 not exist I still have an EMPTY car object.
Option #2.
Instantiate the application server.
Dim oAppServer as New AppServer
Instantiate an instance of the car object….
Dim oCar as Car
Fetch the one I want..
oCar = oAppServer.FetchCar (83726)
Should car ID number 83726 not exist the car object is = Nothing.
And how about a collection of cars
oCar = oAppServer.FetchCars (RED)
Your comments?