Because a large part of our efficiency comes from open-source sharing and re-use of successful code modules, we believe in the power of open source. So much so that we frequently share our own code with other developers; yes, even our competitors.
Headspring is proud to have contributed to the following:
- AutoMapper 230,219 Downloads
- MVC Contrib 142,109 Downloads
- CodeCampServer 4,241 Downloads
- Solution Factory for Vs.Net 3,180 Downloads
- Tarantino 2,811 Downloads
- .NET Accessibility Analysis Kit 181 Downloads
Better tools for a better framework
MVC Contrib is a collection of assemblies which add additional functionality to Microsoft’s ASP.NET MVC Framework. Microsoft’s approach to the Model-View-Controller pattern is already impressive, but MVC Contrib furthermore fills in some of the gaps. Included in the bag of tricks are:
• Additional Restful Routing Capabilities
• Advancements in Controllers and Action Results
• IoC Container Controller Factories
• Model Binders
• Resharper Templates
• UI Helpers
• Unit Testing Test Doubles
• View Engines
Give your Views only what they need
Utilizing AutoMapper, multiple object relationships of complicated bridging may be easily flattened into more simplistic objects more agreeable for passing to ASP.NET MVC Views. For example, if one wishes to display a table showing names, company names, and street addresses of persons in a contact management application where an Organization may have both numerous Employeechildren and numerous PhysicalAddress children, it would be more advantageous to make a dummy object to pass to the View than to pass arrays of Organization, Employee, and PhysicalAddressobjects to a View and then undertake cross-object matching by way of embedded code which cannot be tested. AutoMapper helps keep the front end clean.
If one were to make a display-friendly version of an Employeeobject called Dto which only held string type parameters and no references to other objects, then an array of Dto objects might make for good data fuel for the View in the example above. Obviously, one could write code within a Controller to manage the consolidation of Organization, Employee, and PhysicalAddressobjects into Dto objects without AutoMapper, but AutoMapper makes it painless. Observe:
MVC in Action
Many of the Model-View-Controller examples covered within Manning Publication’s “MVC in Action” are exhibited in the Codecampserver application, which, as the name implies, is an application for managing attendees and sessions at a technical conference. In addition to using ASP.NET MVC this application utilizes the Tarantinotoolkit and the Onion Architecture and thus serves as a good example of how Headspring developed .NET code manifests in our work.
Why start from zero?
Instead of making project B from a copy of project A and then stripping out all A-specific content and renaming all A-specific references, you will almost certainly find less heartache in keeping your consistent architecture in a Visual Studio template and then instantiating new projects from the template. Solution Factory for Vs.Net makes the templates for the latter approach. The project allows one to export an existing Visual Studio solution as a template that may then be added to Visual Studio to allow one to select the template as a type of new project upon creating a new solution. All projects, associations between projects, and .dlls in the parent solution are immediately available in solutions created from the parent’s template. This spares developers the headache of trying to carry over the architecture from an existing solution to a new solution by a copy-and-rename means. .msi installers are created by Solution Factory to allow parties to easily add templates to an install of Visual Studio.
Our Preferred Toolkit
Tarantino.zip contains many useful .dll files (NHibernate, RhinoMocks, StructureMap) and programs (NAnt, Subversion) which comprise a common set of tools which Headspring uses for Greenfield applications. Additionally, the Tarantino project contains a database change management system.
A common Headspring .NET application is structured as such:
• Typically, we keep source code in Subversion repositories. NAnt scripts build from the repositories to staging and production servers. In doing so they also update a database at each build locale with any pertinent SQL scripts not yet run against the database. (A progressive history of SQL scripts is kept for each project.)
• Our applications themselves break up the projects within a given solution into the Onion Architecture. The User Interface (front end) references both the Domain (business logic) and the Infrastructure (database integration). The Infrastructure references the Domain (instead of the other way around in traditional layered architecture) leaving the Domain as the autonomous, independent center of the application. Domain objects are loosely-coupled to counterpart data managers in the Infrastructure by way of StructureMap.
• Separate Unit Test and Integration Test projects exist for both the Domain and the Infrastructure. Objects are often mocked in tests using RhinoMocks.
• NHibernate is used for database integration.
Testable U.S. Rehabilitation Act Compliance Verification
NAAK is designed to allow compliance with the U.S. Rehabilitation Act, Section 508. This law lays out several web development guidelines to ensure web applications are accessible by people with disabilities. XHTML must be formatted in very specific ways in order to be in compliance with the U.S. Rehabilitation Act, Section 508. Of all of the tools for testing XHTML for compliance, NAAK is unique in that it may be accessed by way of WATiN, WATiR, and Selenium automated tests, allowing for testing on the far side of forms (including login controls for protected pages/content).