Search This Blog

Friday, June 10, 2011

SubSonic

SubSonic is a data-layer builder. More than that, it's an auto-magic object-relational mapping (ORM) tool.

 SubSonic reads the structure of your database, and builds classes to provide you with a fast and flexible data access layer. It requires minimal configuration to set up, provides you with a number of different methods for retrieving and saving data, and includes methods to customize the classes  

Once you have created your DAL with SubSonic, either manually or using the build provider, you are ready to begin to query your database. At this writing, there are providers for a number of databases:

    Microsoft SQL Server 2000 or 2005, including Express
    MySQL
    Oracle
Compared with other ORMs, SubSonic requires remarkably little configuration. At a minimum, you will need to add the following to your web.config (or app.config) file:
  • One or more connection string
  • The SubSonic section handler
  • A link between the appropriate connection string(s) and the SubSonic classes

SubSonic generates three classes for each table in your database:
  •  A singular version of the table name. For example, if you have the table Products, the class will be named Product. This is a strongly-typed class representing a single row in the table. Each column in the table will be represented by a strongly-typed property of the class. Fields that accept null values are defined as nullable.   
  • A controller (e.g. ProductController). This provides the basic CRUD (Create, Retrieve, Update and Delete) functionality. You can use the Controller class as the data source for your page using the ObjectDataSource control.





No comments:

Post a Comment