mardi 21 février 2017

Static methods and table data gateway patter

I implement table data gateway on data access layer and transaction script on business because. Is it possible to make table data gateway with non static methods and therefore create DAL objects in BL to calls gateway methods?

Now I do

var result = myGateway.SelectAll(p1, p2, p3);

with non-static methods it would be

var MyGWObject = new myGateway();
var result = MyGWObject.SelectAll(p1,p2,p3);

in every transaction (probably organized as a class and the object would be its private variable).

Is this ok or really bad? And also is the second approach when object is created more like Table Module or just some mess?

Aucun commentaire:

Enregistrer un commentaire