|
Collection Class Topic updated 25-4-2007 |
|
Every Table Template in a BO-Layer project generates one Collection Class. The Collection Class is a strongly typed collection used by applications for in-memory storage of multiple instances of a POCO Class. Multiple row resultsets retrieved from the database are handled as Collection Class object instances in the BO-Layer. POCO Classes have collection properties of Collection Class types to model database entity relations. Some CRUD operations implemented in Factory Classes use the Collection Class as a method parameter or a method result. The Factory Class does not implement any data access code. This is handled by the Factory Class generated by the same Table Template. Manipulations on Collection Classes (adding and removing POCO Class instances) do not cause database updates directly. Database updates only occur when CRUD operation implemented in Factory Classes are called.
Databinding To support databinding, the Collection Classes use as their base class the System.ComponentModel.BindingList<T> generic class from the .NET Framework 2.0. As a result, ASP.NET 2.0 applications can use the ObjectDataSource control to directly bind controls such as the GridView to instances of Collection Classes generated by the Table Template. The GenWise ASP.NET 2.0 Templates take advantage of this databinding support, and take away a lot of development effort to actually get it to work. The Browse Template and the DropDown Template are good examples of this.
|