Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Never change an Interface? 2

Status
Not open for further replies.

VBRookie

Programmer
May 29, 2001
331
US
Hi,

I know that the rule is that you should never change an interface once implemented. But if I create an object that is inserting data into a database and the user is passing me the values and the underlying table changes down the line, where now the user will have to pass me more values and I'll will have to receive more to do the insert, wouldn't that require an adjustment to the interface or do I just create a new interface and reference it in the class?

I'm trying to place all of my DB calls in a DLL and remove it from my application but I'm not sure if that's the best way to go.

Should I have the user only pass me the values for the insert or the Insert SQL statment itself?

Any direction here would be greatly appreciated.

- VB Rookie
 
Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm,

Perhaps you can squeak through the crack. Define a UDT to hold the data values you will process. Have the interface pass you the UDT (values filled in). You can generate and re-generate the udt for each change of the db schema.

Of course, this is somewhat a slight of hand method. On the "other (FAT?) of HAND", if the schema /structure is changing, the change needs to implemented SOMEWHERE/HOW! Re-defining the UDT is perhaps easier than re-defining the interface, particularly since this part could be done programatically, using the schema/structure which is available via code.

From a third perspective, while the 'rule' is to preserve the interface, even MS has pressed this one well past the 'limit of plastic deformation'. If you look closely, MS has even 'sold' different programming communities on different versions of the SAME interface, not to mention the changes in 'interface' to functions within a specific language. Just peek at some of the 'stuff' that is different between versions of VB.

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Toe options for passing changing data into a constant interface . . .

1) Marshal ADO Recordsets (Clientside of course)
2) Pass XML strings containing your data.

- Jeff Marler B-)
 
? ? ? " ... Toe options ... " ? ? ?

Dirty feet?

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Thanks dudes,

I think that I will look into the UDT and XML options.

- VB Rookie

Simple Thoughts:
The beginning of Happiness is the letter "H".
 
MichaelRed,
Toe . . . two . . . opps! (followed by . . . DOH!) If I could type, I'd be dangerous! ;-) - Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top