Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Community Bloggers

Browse by Tags

All Tags » Patterns   (RSS)

  • MVP & MVC simply put

    This question seems to get asked a lot, this recent article on codeproject does a decent job of explanation as well as this article from Infragistics Guidisan Todd Snyder . If I was sum it up very simply, the different is entry point into the pattern. In MVC the entry point is the controller, if you look at the Microsoft MVC framework for example the controller class is where you bind your view and everything else (model) together. In MVP mean while the entry point is the view, webforms lends it's self very well to this pattern as you can bind the aspx and your view and use the normal aspx entry point to get at the rest of your patttern (in fact winforms works well on this pattern as well). Going a bit further You can break down your view into two, a view and View-extender. The temptation in webforms land in a passive sense of the pattern is hold all sorts of view centric items on the presenter. If you have lots going on in your presenter for your view and you want to keep your view ultra Read More...
  • The design in TDD

    Lately I've been drafting posts on my daily commute and post them up in batches (just in case you were wondering :). I recall an article (not sure where I read it) about Ron Jeffries and his ability as an 'alpha architect'. Such people are rare, the design they have mostly in their mind with TDD providing a way of slightly reshaping the design and proving the model (in a pair session that can mean validating each other’s ideas). Another kind of folks is the folks that have a general system picture but design a piece at a time with model shaping and validation occurring as they go. Both are no less a way of designing and developing a system but while the 'alpha architect' has considered overall, system considerations and won't introduce design faults, the other folks need to go carefully to avoid those faults. The point that TDD is a design process seems to get missed, writing tests before your code is only part of the process and not the sum total. The trouble I have found is that the design Read More...
  • Is ASP.NET good enough for startup's

    James Avery has a link to Jeff Eaton post that asks "Why not ASP.NET [for startup's]?". Let's consider that if this is a cost thing then it's running Windows (costs) as opposed to Linux (free, unless your paying for support options but its relative). ASP.NET\Visual Studio Express (web edition and c# edition) are free. Jeff's remaining points can be addressed as Webform issues not ASP.NET issues, if your looking for Rails style in ASP.NET then projects like Castle MonoRail shoild be your first port of call. You can find all the power, flexability, community and all that Rails goodness and it's built onto of ASP.NET framework. To be fair to webforms, it's short comings are well know, it's product team is hard working in solving those problems and as a great community (which extends to the ASP.NET framework as a whole) of users and problem solvers\experts like the MVPs and ASP Insiders. To address problem 1, if you want to cut costs and run Linux you can still use ASP.NET using Mono. Mono Read More...
  • SubSonic and MVC

    Rob has been busy, creating two SonicCasts :) MVC and using SubSonic MVC templates . Rails from a ASP.NET POV . MVC can be little confusing ( look at the confusion with MVC1 and MVC2 for example), webforms in some respects does follow MVC but ideally the layers and concerns need to be isolated and that is where the problems start. However, ASP.NET as a framework can be built to support a MVC framework (look at Castle MonoRail for example) but still some problems remain, needing to create IContex for Context\HttpContext for example . Scott is on the case however , so overall good times ahead. Read More...
  • The Presenter First pattern

    In pattern terms there will be a few patterns for visual interface layering that you heard of, MVC, MVP, Humble Dialog etc. I was talking with Howard one night and he mentioned his interest in a MVP variant called Presenter First. This variant incrases the layering of MVP triads in the pattern and brings a more TDD approach to the pattern. The paper is a must read as is the interviews the authors had with Ron Jacobs , there is also further examples here and here . On a related note visual interface patterns for me still seem to fail the issue of dealing with threads and managing an interfaces behaviour in a thread, I was talking this through with Jeff and he later blogged his thoughts here . Read More...
  • The trouble with webforms

    Ayende has a post on "Removing the leaky abstractions from webforms", webforms do leak abstractions like a water mains with a hole it. I see folks going to great lengths to reduce page bloat by removing all viewstate and in the process creating a kind of ASP on .NET model. MonoRail helps you achieve this goal and does provide a clear seperation of concern by following MVC closely. Read More...
  • Using IoC with Castle MicroKernel

    Inversion of Control or IoC is very simply put a pattern defined by Martin Fowler for injecting a class's dependencies. IoC helps with mocking objects and thus a dependency of a object. It helps improve testability of a object because of the easy of mock object injections. Java and .NET have a good collection of OSS frameworks for IoC, Spring is quite popular in the Java world and Spring.Net in the .NET world. There is quite a lot of XML configuration to Spring and a alternative and popular choice in the ..NET world is Castle MicroKernel . The documentation is top notch for learning how to use this framework with a work through guide , well worth a look. Read More...
  • MVC, such a big deal?

    This is one of the posts where I should be going to bed rather than starting this but I just won't sleep if I don't post it. I was going over the comments in Ayende's post on Castle Igloo and noticed someone had posted this. "Communication between a view and its associated controller is straightforward because View and Controller are specifically designed to work together. Models, on the other hand, communicate in a more subtle manner." "Unlike the model, which may be loosely connected to multiple MVC triads, Each view is associated with a unique controller and vice versa. Instance variables in each maintain this tight coupling." -- Applications Programming in Smalltalk-80(TM): How to use Model-View-Controller (MVC) http://st-www.cs.uiuc.edu/users/smarch/st-docs/mvc.html In fact if you read Martin Fowlers essay on GUI Architecturer it captions a MVC UML diagram with Essential dependencies between model, view, and controller. (I call this essential because Read More...
  • Castle Igloo

    Ayende has a very interesting post on a new project from Castle called Igloo, a MVC implementation for webforms . Webforms are tricky to adapt to MVC or MVP because of code behind, it makes the view a two part visual and event controller that which in in turn makes the controller a two part controller class and code behind and in turn binds the view to the controller tightly. True degrees of seperation are lost. Igloo does look to make the controller and view not aware nor dependent on each other. If you treat the code behind as a lightweight display mech and allocate more into the controller class then you have a good MVC approach. You will still have the problem of consuming events in the controller class from the view and removing web dependencies in the controller, the many problems of webforms. True MVC on ASP.NET is still the domain of Castle MonoRail but I will explore Igloo will interest. Read More...
  • Applying the MVP pattern in winforms

    Some great articles from. Dan Bunea Jeremy Miller Michael Feathers I wonder how folks are overcoming threading issues when applying a pattern such as MVP to their GUI (updates to GUI components occuring in a thread for example), thoughts welcome. Read More...
  • RoR style database migration for .NET

    Marc has the details on a RoR style database migration for .NET that is wrapped into the Castle Generator project. The Castle Generator project is very interesting too, this is a RoR style Scaffolding system. Read More...
  • Webbness, Boo + Rails

    I've started taking a look at Boo for some very early MbUnit protyping. While exploring the site I came across Webbness which is a Rails style MVC framework (along with code generation and ORM) for ASP.NET that uses Boo. It's not clear if it generates MonoRail style unit tests for each pattern layer but that would rock. Read More...
  • Web frameworks 2006

    I am writing this now as the end of the year approaches as I am sure that by the end of 2007 the web framework landscape will have changed again. Only a few years ago a web developer had Perl\CGI then along came ColdFusion, ASP and PHP. Until recently that's the way it was for web developers and very often each company would cook their own bespoke web framework with varying power around these. Then some chaps looked at Ruby as much more powerful dynamic language and cooked up Rails, no need for bespoke when now have a very powerful one to hand that you can adapt. Of course in between these was JVM\Structs and CLR\Webforms but the need for complete control over output (and in some cases control over every inch of the framework) ment that these did'nt factor in some cases. Rails is gaining new members of its audience every day, drawn by the fact that it lets you get your job done quickly (like common database tasks with a ORM , like common output rendering, like moving databases etc) Read More...
  • MonoRail in a commerical world

    MonoRail is a very hot topic with me right now so t his post from Scott Bellware is timely . Scott makes an interesting point. [MonoRail] simplifies web development on .NET much in the way that Ruby on Rails simplifies web development period. Corporate shops building web apps on .NET are largely staffed with developers who have been exposed only to those ideas and approaches that Microsoft has allowed passage into its customer collective consciousness. Rails exposes a number of key concepts to the consciousness, namely patterns (like MVC) and testability, and these are baked right into the framework. You can use Rails and not be aware your using these things because it's a a part of the framework, you don't have to go to any extra lengths to make use of patterns or achieve testability because the framework is built on these things. In web space of .NET these things feel unnatural because webforms does not make use of them. MVP and MVC in a webform context feels unclean because you Read More...
  • Castle RC2

    Ayende has a great post on building applications (with a dash of TDD) using the Castle RC2 release, some things stand right out here in that testability and patterns are baked right in (with the VS projects supporting this structure). Share this post: Email it! | bookmark it! | digg it! | reddit! Read More...
More Posts Next page »

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us