a dynamic journey of concerns
DESCRIPTION
How can we keep our templates clean and front-end-developer-friendly? How can we make our code testable? How can we reduce our development time, and improve quality at the same time? Some questions I asked myself before starting with the Macaw.Umbraco.Foundation. This presentation takes you on a journey through a foundation we use at Macaw. Where dynamics and separation of concerns are key.TRANSCRIPT
A dynamic journey of concerns
Jeroen Wijdeven
Agenda
1. WHY? 2. Concerns and Responsibilities 3. Dynamics 4. Features 5. Questions
WHY? 1
WHY?
I don’t like
Because I don’t like code!?! In views
WHY?
I don’t like
Because I don’t like code!?! In views
WHY?
I don’t like
Because I don’t like code!?! In views
Why?
This seems a lot cleaner to me
Why?
This seems a lot cleaner to me
Why?
This seems a lot cleaner to me
Goal
, and Standarisation
• Standarisation
• Single Responsibility
• Testability
Results in:
• Improve overall quality
• Reducing development time
Concerns and Responsibilities 2
Concerns and Responsibilities
Separation of Concerns
• Models are for business
• Controllers are for interaction
• Views display information
Goal reached with mainly 2 practices
Separation of Concerns
• IPropertyValueConverters (previously called IPropertyEditorValueConverter)
• Dynamic“View”models • Implement IPublishedContent so you can still use all the Umbraco beautiness • Is using the DynamicPublishedContent eco system • Act as a proxy for every IPublishedContent (RenderModel.Content) • Containing commonly used functionality like
• Hompage property for global settings • Breadcrumbs • Default ToString() string converters • etc..
Umbraco
Separation of Concerns
Umbraco + Foundation
Separation of Concerns
Dynamics 3
The dynamic type simplifies access
to APIs, or like in our case, the
IPublishedContent Properties
collection.
“ “
Dynamics
Dynamic vs Typed
For example this:
Instead of this:
Dynamics
Example implementation
Features 4
Talk is cheap. Show me the code! “ “
Questions 5
Contact: mail: [email protected]
twitter: @chuhukon
• https://github.com/MacawNL/Macaw.Umbraco.Foundation
• http://jeffreypalermo.com/blog/the-onion-architecture-part-1/
• http://our.umbraco.org/documentation/Reference/Mvc/custom-controllers
• http://www.codeproject.com/Articles/66585/Comparison-of-Architecture-presentation-patterns-M
• http://msdn.microsoft.com/en-us/library/dd264736.aspx
• chuhukon.nl
Urls