GetObject -- possible improvment.

Jan 7, 2010 at 8:02 AM
Edited Jan 7, 2010 at 8:04 AM

I really like OPF3 .... its very easy to get going and to use.

One thing I thought was a bit odd is this syntax below :

GetObject(Of User)("UsersID = {0}", 1)

I understand the flexibility of this, but wouldn't it be great that since "UsersID" in my database is the Primary Key, I could just call :

GetObject(Of User)(1)

This overload would just assume the Query is refering to the Primary Key and means the DEveloper needs less idea about the structure of the object, and if hte DB structure changes, these calls would not need to be updated.



Jan 8, 2010 at 1:02 PM

Hmmm... The question is what if you use a composite primary key in your database? It is getting complicated. This way you have a generic syntax that works with everything.

Jan 8, 2010 at 1:07 PM

Excellent point !

I shall return to underneath my rock :)


Cheers.... and EXCELLENT WORKS !

Jan 10, 2010 at 9:27 PM

No problem. Keep the great feedback coming!