Friday, February 24, 2012

How to build SQL Commands in a Remote Database Component

Hello,

I'm trying to develop a remote database component for the server that interacts with the database directly. I would like to pass in my object to the corresponding add, update, delete methods and have the database component generate the script to do the corresponding transaction to the database. However, I cannot find a viable solution yet. The only method that I have found so far is passing the exact SQL command to the database component for it to execute. This would require making a 3 SQL Statement (one for add, update, and delete) for each class.

Thanks,

Kiet Quach

I would back up a bit here. I think your approach is flawed.

your objects should be MarshalByValue/serializable. the object should be passed across the wire to a service, the object then would process itself as it should know how to manipulate its own contents.

I highly recommend Lhotka's Expert C# business objects

"object-oriented" means orient to the object.

What you are proposing is a "service-oriented" data access solution and I wouldn't recommend that for data processing. On the other hand, A hybrid achitecture - a solution that services self contained data objects object is quite appropriate.

|||Thanks Blair for the input. However, there is a reason why I wanted to only pass the object, I want to maintain database independence since my customers use a different database platform. Therefore, it would be a lot more scalable if I could create the SQL commands in the database component.

Kiet Quach|||thats what I am saying. . . read lhotka!

No comments:

Post a Comment