Agile Web Development with the Castle Project 15/05/2008, Skills Matter Gojko Adzic

Slides:



Advertisements
Similar presentations
Castafiore platform Consists or intend to consist of 1.Advanced Web framework 2.Advanced Graph database 3.Designer studio (something like visual basic)
Advertisements

Introduction to ASP.NET MVC
.NET Database Technologies: Open-Source Frameworks.
Web Applications Development Using Coldbox Platform Eddie Johnston.
ASP.NET MVC Best Practices Simone Chiaretta Solution Developer, Avanade 21 Ottobre 2009.
Fabian Vilers Hands on ASP.NET MVC.
Ruby on Rails by Manik Juneja Ruby On Rails. Ruby on Rails by Manik Juneja Rails is a Web Application development framework. Based on the MVC pattern.
Software Architecture Patterns (2). what is architecture? (recap) o an overall blueprint/model describing the structures and properties of a "system"
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
By Bob Bunson  Simulation of software development project  Fictitious system from Concept to Code  Oriented around the.
Struts 2.0 an Overview ( )
UNIT-V The MVC architecture and Struts Framework.
Lecture 2 - Struts ENTERPRISE JAVA. 2 Contents  Servlet Deployment  Servlet Filters  Model View Controllers  Struts  Dependency Injection.
A little engineering on Rails Robert W. Hasker. Goals Intro to the Rails framework ▫Basic concepts: MVC, Active Record ▫A bit of Ruby Using Rails to build.
RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions.
Storm-The-Castle an introduction to MVC, AR design pattern using Castle MonoRail and ActiveRecord rev 2 Date: 2009/10/04.
ASP.NET MVC 3 and Some 4 JaxCodeCamp August 2011.
WebWork in Action An introduction to WebWork Patrick A. Lightbody.
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
CodeIgniter - [Overview]
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Entity Framework Code First End to End
Spring Overview, Application demo -Midhila Paineni 09/23/2011 Spring Overview, Application demo9/8/20151.
ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:
Building Web Sites with ASP.NET MVC Framework Noam King CTO Sela College
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
Extending ArcGIS for Server
Introduction to ASP.NET MVC Information for this presentation was taken from Pluralsight Building Applications with ASP.NET MVC 4.
Copyright © 2005 Finetix LLC All Rights Reserved 0 SpringFramework.Net Developer Session Chris Donnan The Peer Frameworks Series -.Net and Java.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Effective Test Driven Database Development Gojko Adzic
Introduction to Web Dimitar Nenchev Ivan Nakov
Castle Manoj Waikar Pune, India.. Introduction Castle aspires to simplify the development of enterprise and web applications. It offers a set of tools.
Effective Test Driven Database Development Gojko Adzic
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
Developing AJAX Web applications with Castle Monorail David De Florinier Gojko Adzic Skills Matter 12/06/08.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Forms with Spring MVC Handling Form.
Alternative Architectures: Inversion of Control Mike Hadlow mikehadlow.blogspot.com.
Model View Controller MVC Web Software Architecture.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
INTEGRATION OF BACKBONE.JS WITH SPRING 3.1. Agenda New Features and Enhancements in Spring 3.1 What is Backbone.js and why I should use it Spring 3.1.
Putting Performance Best Practices Together to Create the Perfect SPA Chris Love2Dev.com.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
Declarative Languages and Model Based Development of Web Applications Besnik Selimi South East European University DAAD: 15 th Workshop “Software Engineering.
2006/2007 Licence Apache 2.0 Castle.Igloo. Castle Igloo Basics Pre-require Concept Scopes PageFlow Configuration Controller View Exemple Castle.Igloo.
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
Jean-Claude Trachsel Senior Consultant, Trivadis AG The good news.
Model-View-Controller an introduction to MVC design pattern with Castle.MonoRail Presentation: v1.0 Prepared by: Chorn Sokun
Ruby on Rails. Web Framework for Ruby Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller –almost.
Intro to MVC5 Bryan Soltis Bit-Wizards - Director of Technology & Research.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
1 Rails for the Ruby-Impaired John Paul Ashenfelter CTO/Transitionpoint.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Creative Commons Attribution- ShareAlike 2.5 License Sakai Programmer's Café Sakai Oxford Tetra ELF Workshop Comparative Display Technologies in Sakai.
Web Technology Solutions
MVC Architecture, Symfony Framework for PHP Web Apps
ASP.NET MVC Introduction
Ruby, Rails, GUIs, and More
MVC Framework, in general.
Ruby on Rails by Manik Juneja
Intro to Spring CJUG - January 2013.
Ruby on Rails by Manik Juneja
Presentation transcript:

Agile Web Development with the Castle Project 15/05/2008, Skills Matter Gojko Adzic

Why should you care? Increases programmer productivity Allows us to apply modern programming practices (AoP, DI) Provides a solid foundation for agile web programming Brings best ideas from Spring/Java and Ruby on Rails to the.NET world

What is it? Several loosely-coupled components –Windsor IoC and AOP container –ActiveRecord data-access –Monorail MVC –Bunch of other libraries (Dynamic Proxy…) You can use them separately Even more productive when used together

But it is a RC! A bad marketing decision RC because it is work in progress, not because it is unstable I’ve used it in production for about two years now, no problems at all

Application framework Mix between Spring and RoR Integrates with almost anything Lightweight, short learning curve Convention over configuration Lots of helpers and utils Nothing is enforced

What do we get? Very efficient programming model Almost all the plumbing is already there Testable web apps (everything below the UI) Will age gracefully

What do we lose? ASP.NET components MS stamp of approval “this is not.NET” attitude might be a problem Need more training, probably cannot hire people off the street

ActiveRecord Simple O/R –Class=table –Object=row –Property=column value Configuration by code attributes Uses NHibernate under the hood

ActiveRecord (+) Incredibly simple O/R mapper Simplifies NHibernate configuration for common cases Unit-testable Supports validation Great integration with MVC engine

ActiveRecord (-) Bad separation of concerns –It represents domain code –It also dictates storage Generally better for green-field development

Key stuff to remember for AR the class needs to be annotated with attributes create a dedicated assembly for ActiveRecord types beware of using names that are DB keywords use ActiveRecordValidationBase if you want validations to work

Key stuff about AR testing Kill the initialisation flag in unit tests to allow re-initialisation ActiveRecord can generate the schema for you, but this is not perfect Don’t forget to flush Try to reload objects and verify properties

You don’t have to use AR! Castle integrates with NHibernate and IBatis nicely Data mapping and validation works on plain CLR objects A bit more code, but much more flexibility

Monorail MVC based on Rails Smart url mapping –Class=folder part of the URL –Method=file part of the URL Takes care of all HTTP plumbing Flexible view engines

Monorail: Controllers Basic building blocks of Monorail Responsible for workflow and session Group related workflow steps SmartDispatcherController binds GET/POST variables to method arguments No formatting!

Monorail: Actions Perform a single step in the workflow Prepare data for the view (PropertyBag) (optionally) Select the view Chaining/Reuse patterns –Call method –RenderView –RedirectToAction Use Flash to pass messages while redirecting

Monorail: Views Data formatting Simple scripting, related to UI Formatting No business code, no workflow code

5-minute Velocity guide $varname (or ${varname.property}) #if / #end #parse to include other scripts –Partial templates with #foreach

Monorail: Helpers Utilities for formatting Generating UI code –Forms –Ajax (prototype, js proxies) –Or roll your own

Monorail: Layouts “Master pages” or templates Use $childContent to embed views Use $siteRoot for relative paths Set by attribute on class or method

Monorail: Components Reusable parts of the layout –Menu bars –Shared functional parts Alternatives –Use Helpers for formatting –Use partial templates and loops for repeatable content –Can also be done with Ajax DIVs

Monorail: Filters Actions to execute before or after controller actions Simple web AOP –Authorisation –Logging

Monorail: Rescues View called on error –Specify on whole controller or on action –Generic or bound to an exception Individual actions do not have to worry about error handling in most cases -> less code

Monorail and ActiveRecord Extend ARSmartDispatcherController Data-mapping to load record objects: –ARFetch –ARDataBind Scaffolding Not the cleanest solution – storage and business logic mixed – but very productive

Monorail Unit Testing Use BaseControllerTest from Castle.MonoRail.TestSupport Call InitController to prepare the environment Test the class like any other Inject services into containers so that you can test them in isolation

Monorail (+) HTTP Request plumbing Smart dispatching, data binding Convention over configuration Unit testing Fantastic AR integration Several layout engines

Monorail (-) Attribute based layout and area selection Hashmap for view properties –I have mixed feelings about this Windsor integration a bit too complicated –Maybe use service locator pattern in this case

Key stuff to remember (MR) Override the web app to initialise AR Use data-binding to load whole objects Put stuff into PropertyBag to pass to a view layouts are page templates Use the Flash to simplify workflow Learn standard helpers and use them

Windsor/MicroKernel MicroKernel is an IoC/AOP framework Windsor loads configuration from files Manage component pooling and lifestyles Provide interception

Windsor: Components Components are application building blocks They can provide a service Constructor arguments and properties can be automatically resolved –Constructor args are mandatory –Properties are optional Lazy Loaded!

Windsor: Facilities Extend the framework by hooking to component events –Attaching interceptors –Integrating with 3 rd party libraries Standard Facilities –Automatic transaction management –Logging –Starting/stopping components

Windsor+Monorail Inject services into controllers Add IContainerAccessor to web app, initialise ONE Windsor context on start Makes controller code even more simple, but complicates configuration Alternative is to use service locator

Windsor: Key stuff to remember Services are automatically resolved by interface Components are lazy loaded Initialise only one context per application Beware of cyclic dependencies Use Features and Interceptors for AOP

Why I like Castle Makes simple things very easy, but allows doing complex stuff as well Co-operates with other popular libraries Convention over configuration AR+MR Great for prototyping Allows us to cover big parts of web code with unit tests

Where next? ALT.NET beer meeting – straight away 21/05 MS EvilLink demo app: