Data | The porting of database databases often brings high costs. I have a deep understanding of this. The size of the cost depends on how the program's architecture is written. Last year, a project was moved from MySQL to Oracle, and the entire program was tinkering in and out, and it took about two months.
If you do less modification, and even do not modify the code, the compatibility of the database is undoubtedly a very good thing,
PetShop did it very well.
To be compatible with multiple databases, you first need to implement polymorphism. Sqlserverdal and Oracledal both implement the method of all interfaces in Idal and realize polymorphism.
Factorydal is used to create a Dal object,
public static PetShop.IDAL.IAccount Create ()
{
Look up the DAL implementation we should to be using
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service