Interview question: SQL Server and AS400

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I had an interview today and I looked at their ASP.Net/VB.Net app. I was told that the app interacts with AS400/IBM and SQL Server;therefor, the ex-developer developed 2 sets of "data" tier...one to interact with AS400 and one to interact with SQL Server.

My question is: did he actually need to develop 2 sets of "data" layer/tier code?? Couldnt there be logic to use, for example, this data connection, if it's AS400..go down this path if it's SQl Server?? How would you design a data layer/tier to interact with 2 databases?
 
He was probably too stupid to figure out how to build a common interface between the databases.

There are a few ways to build an api to interact with multiple db servers.
Looks at the ado.net design. Common interfaces and base classes, and then specific objects when it comes to actually connecting and running queries on the server. Or you can use objects that themselves check for the type of db, such as odbc.

Also, there are third party persistence api's that are able to interact with any db's they have drivers for.
 
do u have a simple example or a link to an example?

I think having separate code ...one for SQL, one for AS400...makes it tedious to change.
 
Back
Top