Differences between revisions 1 and 12 (spanning 11 versions)
Revision 1 as of 2009-06-18 01:31:37
Size: 1095
Editor: 24-183-238-75
Comment:
Revision 12 as of 2009-12-17 16:32:26
Size: 2934
Editor: 24-183-238-75
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= C# Programming Object Model = = Programming the Object Model =
Line 3: Line 3:
The next few sections discuss the overall approach to programming the database interface. WARNING: This was done in a frenzy and will most likely need to be reworked! Time was much more important than neatness. Later we WILL be introducing some better "software engineering" practices. At the time of this writing we already have over 57 KLOC. The next few sections discuss the overall approach to programming the database interface, business objects and back end systems. For a second iteration, we are considering the following technologies to clean up the implementation:
Line 5: Line 5:
== Visual Design ==  * SQL CE synchronized to a back end system instead of SQL Server Express (See http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx and look for Synchronize corporate data)
 * NHibernate (http://nhforge.org/Default.aspx) and possibly Fluent NHibernate (http://fluentnhibernate.org/) for database business objects instead of hand coding the ObjectRelationalMapping.
 * SpecExpress framework for specifying property rules validation (http://code.google.com/p/specexpress/). Quite frankly, the validation is not happening right away.
Line 7: Line 9:
We are using Menus and tabbed panels within tabbed panels. Until we have time, look at the design for more info.
== Visual Design Elements ==

We are using Windows Forms to create an interface with Menus and multiple layers of embedded tabbed panels. Until we have time to add to this section, look at the design for more info.
Line 11: Line 16:
'''FORM CONTAINS:''' We are building a Model View Controller (MVC) application.
Line 13: Line 18:
 * HashMap<FieldRomanNumeral,FieldData{''Field Information'', ''List<SquareData>''}>
 * HashMap<FieldRomanNumeral|SquareDesignation, SquareData{''Square Information'', ''List<BaseLocusData>''}>
Our '''model''' is contained in a Dataset object ArchDataset.xsd along with the ancillary host of helper objects. Although these are very complex, they are standard elements and perform in expected ways. We will not cover them in detail. To find out more information about this particular model, see the ArchaeologyProject/DataModel.
Line 16: Line 20:
Incidentally the ''List<SquareData>'' should match the tabs shown under the squares tab for that Field. Can we map it directly? The '''view''' is contained in [Name]Controls.cs and Forms files. These are organized under the directories Forms, FormControls, and Controls. These hold the visual components that display data and contain visual elements that allows the user to interact with that data. Currently we are using windows forms. In the future we would like to move to WPF.
Line 18: Line 22:
Also, the ''List<BaseLocusData>'' maps the the list of tabs showing the loci - ''even though'' these are not "controls" each BaseLocusData element will contain controls. The '''controller''' components glue the underlying model to the views and make extensive use of the Dataset paradigm to speed the development process. This is the most complicated part to be programmed. And deserves the greatest attention. In a moment of weakness these were seen to work more with the model than the view and are organized under the Data folder.

== Controller ==

The controller interacts with both the Model and the View in the following ways: Creating new forms, Loading Filled Forms and Saving Changes to forms.

=== Creating New Locus Forms ===

New forms are created by menu selection while viewing a square. The menu creates a LocusDataEarth, LocusDataArchitecture or LocusDataInstallation object. These are controller objects. The tab control is acquired and a tab page added with the appropriate labels. Then the controller object provides a ctrlPannel that is placed on the Tab. The control pannel provided by the controller object is linked in such a way that interaction with it, is reflected in the controller object and as needed back to the database.

Programming the Object Model

The next few sections discuss the overall approach to programming the database interface, business objects and back end systems. For a second iteration, we are considering the following technologies to clean up the implementation:

Visual Design Elements

We are using Windows Forms to create an interface with Menus and multiple layers of embedded tabbed panels. Until we have time to add to this section, look at the design for more info.

Object to Database Integration Model

We are building a Model View Controller (MVC) application.

Our model is contained in a Dataset object ArchDataset.xsd along with the ancillary host of helper objects. Although these are very complex, they are standard elements and perform in expected ways. We will not cover them in detail. To find out more information about this particular model, see the ArchaeologyProject/DataModel.

The view is contained in [Name]Controls.cs and Forms files. These are organized under the directories Forms, FormControls, and Controls. These hold the visual components that display data and contain visual elements that allows the user to interact with that data. Currently we are using windows forms. In the future we would like to move to WPF.

The controller components glue the underlying model to the views and make extensive use of the Dataset paradigm to speed the development process. This is the most complicated part to be programmed. And deserves the greatest attention. In a moment of weakness these were seen to work more with the model than the view and are organized under the Data folder.

Controller

The controller interacts with both the Model and the View in the following ways: Creating new forms, Loading Filled Forms and Saving Changes to forms.

Creating New Locus Forms

New forms are created by menu selection while viewing a square. The menu creates a LocusDataEarth, LocusDataArchitecture or LocusDataInstallation object. These are controller objects. The tab control is acquired and a tab page added with the appropriate labels. Then the controller object provides a ctrlPannel that is placed on the Tab. The control pannel provided by the controller object is linked in such a way that interaction with it, is reflected in the controller object and as needed back to the database.

ArchaeologyProject/ObjectModel (last edited 2010-04-06 21:47:57 by 24-183-238-75)