The Umbraco Pylon project has been sat on the back-burner for over 6 months now as we've been tweaking it and evolving it alongside the redevelopment of this site. This week that all changed and the newly refurbished Umbraco Pylon project was isolated and pushed up to Github and NuGet. You can read all about Pylon here.
The documentation itself can be fairly daunting so, as a primer, why would I want to use the Umbraco Pylon framework in my project?
If you are a .net based web application developer and you are building application that requires content to be managed by a CMS then you either have the option of using an existing CMS (of which Umbraco is undoubtedly the king of the crop) or rolling your own if you want more control over how your application functions. The key objective behind Pylon was to provide the necessary supporting classes and tools to give you the best of both options.
Pylon and TDD
Pylon is designed first and foremost to allow you to use best practice development methods such as TDD and BDD with your CMS development. From layered controllers (which wrap up custom controllers to enable the inner code to be unit tested), strongly typed Models and View Models to the linked Umbraco.Pylon.TestSupport library that provides base test classes and objects for mocking out CMS content and media, a Pylon based Umbraco implementation will be much easier to build tests for.
Take What You Like
Pylon has several elements that all hang together but many features are optional so your solution can be as complex or simple as suits your implementation. Controllers, for example, can be either Layered (testable) or Simple (untestable without much pain). View Models can be used or you can take the easy option and use the DocumentType classes that Pylon gives you to feed your views directly. With views themselves you can either use dynamics by using CurrentPage or DynamicModel (they are the same thing in Pylon) or you can use a Strongly Typed model based on a provided instance of IPublishedContent.
Pylon should provide all that you need to build a CMS based app in one of three key architectures. The Ministry site itself uses the combined model.
In the Traditional Model the architecture is built, to a large extent, around Umbraco itself. The app code sits fully within a single website and Umbraco controls the routing to a large extent by DocumentType. Custom controllers can be added and content items wrapped to build application code on top of the content.
This is essentially set up by installing Umbraco, setting up your code libraries and then adding Umbraco.Pylon NuGet references on top.
Inverted Model / Service Model
In the inverted or service model the application is built first and is the entry point for your application. In this solution the Umbraco site is not used traditionally at all and your solution will include a standard MVC site of some kind. Umbraco itself is installed separately or as a child app in a virtual directory.
Within the Umbraco app Pylon defines API Controllers for providing access to content managed data as JSON. The main app can then call these controllers asynchronously. Model code can be shared between applications.
This type contains elements of both. Essentially based on the traditional model, with the Umbraco installation being the core of the application, API controllers are also present to enable access to data as JSON where necessary.
What's next for Pylon?
The code model and usage for the Traditional and Combined architectural models is now pretty solid. The Inverted Model needs some more proofing and investigation so there may be more additions to extend the usefulness of this approach over time or some templates to help build your architectural model up.
The project will be kept up to date with new releases of Umbraco as they come out, probably a few months behind. The goal is that there will be a matching version of Pylon for whatever Umbraco install you have after 7.2.1.