Here's a simple example.
The Developer needs to implement a scenario called "Create User Account". Initially, the developer identifies that a User will have a name and a password.
public class User
{
string name;
string password;
}
This class is mapped in the database as the User table with a name and a password column. The name is unique and used as the identifier. A script is created to create the table with the two columns.
Later, the Developer discovers that an email address should be associated with the User as well giving this kind of a class:
public class User
{
string name;
string password;
string emailAddress;
}
The User table now needs to be modified to include the additional emailAddress column. The scripts to create the table need to be modified as well. Additionally, an upgrade procedure needs to be create that converts from the old format to the new if the database has been deployed.
The Developer should not need to be concerned with these changes to the underlying database. All the Developer should need to be concerned with is adding the emailAddress field to the User class.
Obviously, this is a simple example. Whole additional objects might be added or fields removed or renamed. When multiple changes have been made, these need to be cumulated.
Is it possible to remove this detail from the Developer and generate the creation scripts and upgrade procedure automatically?
No comments:
Post a Comment