R
RichB
I am slightly confused regarding when to use an instance method and when to
use a static method, particularly in the context of a DAL.
I have basically got a class which has methods for CRUD, an object passed
into the method an I return an object representing the outcome of the
operation or in the casse of a search a Data Transfer Object. Each of my
methods are static within an abstract Data Access Class, but I could of
course instantiate an object and use it's methods. In a couple of teching
examples I have seen instantiation of the Data Access Object.
Am I using static methods appropriately? Where is the line drawn between
instantiating an object an using it's methods and using an abstract object
to perform static operations?
Many thanks,
Richard
use a static method, particularly in the context of a DAL.
I have basically got a class which has methods for CRUD, an object passed
into the method an I return an object representing the outcome of the
operation or in the casse of a search a Data Transfer Object. Each of my
methods are static within an abstract Data Access Class, but I could of
course instantiate an object and use it's methods. In a couple of teching
examples I have seen instantiation of the Data Access Object.
Am I using static methods appropriately? Where is the line drawn between
instantiating an object an using it's methods and using an abstract object
to perform static operations?
Many thanks,
Richard