The videos from the Tech Ed 2008 interactive stage are now online. One of them is the software quality panel in which I participated. It’s available in several video and audio formats. I’m the guy in the middle.
Software Quality Isn’t Optional! |
The videos from the Tech Ed 2008 interactive stage are now online. One of them is the software quality panel in which I participated. It’s available in several video and audio formats. I’m the guy in the middle.
Software Quality Isn’t Optional! |
(excerpt from ASP.NET MVC in Action).
Depending on how long you’ve been building web applications on the Microsoft platform, you’ll relate to some or all of the following pain. In the 1990’s, developers built interactive websites using executable programs that ran on a server. These programs (CGI was a common technology at the time) accepted a web request and were responsible for creating an Html response. Templating was ad-hoc, and the programs were difficult to write, debug and test. In the late 1990’s, Microsoft, after a brief stint with Htx templates and Idc connectors, introduced Active Server Pages, or ASP. Active Server Pages brought templating to web applications. The server page was an Html document with dynamic script mixed in. While this was a big step forward from the alternatives, the world soon saw massive server pages with code indecipherable from the markup. In early 2002, along came ASP.NET. ASP.NET was a complete shift for ASP developers because it moved all server page code into a class file and replaced the Html markup with dynamic server controls in an Xml syntax. While performance increased, and the debugging experience improved, new problems arose. The server-side postback event lifecycle caused newsgroups to explode with activity as developer searched for the magic event in which to add those two simple lines of code. Viewstate, while good in theory, broke down as the application scaled with complexity. Simple pages broke 100KB in size, most of which was the Viewstate. Perhaps the greatest sin of the ASP.NET framework was the tight coupling to everything in the System.Web namespace. There was no hope of unit testing any code in the code-behind file, and today we see Page_Load methods that take several trees to print.
The ASP.NET MVC Framework has been introduced to simplify the complex parts of Web Forms while retaining the power and flexibility of ASP.NET. Controlling code is kept in a class separated from hard dependencies, and server pages have morphed into simple views, which are nothing more than Html templates filled in with objects passed in by the controller. The post-back event lifecycle is no more, and viewstate is no unnecessary. In the following chapter, we will walk through your first lines of code built on tops of the ASP.NET MVC Framework. After this primer, you’ll be ready for more advanced topics.
Throughout this chapter, we will take you through creating a new ASP.NET MVC Framework web application project, creating your first routes, controllers, and views. We will comb through the default application and explain each part. Then we will extend it, and you will create your first controller and view.
In this section, we will understand what the MVC pattern is and create our first ASP.NET MVC Web Application. We will focus first on the controller because in the Model-View-Controller triad, the controller is in charge and decides what model objects to use and what views to render. The controller is in charge of coordination and executes first when the web request comes in to the application. The controller is responsible for deciding what response is appropriate for the request.
The MVC pattern is not new. In fact, it is quite old. A core tenet of the MVC pattern is to separate control logic from the view, or a screen. A view is responsible for rendering the user interface. By separating domain logic and decoupling data access calls from the view, the user interface can now stay the same even while logic and data access changes within the application. In figure 1.1, you will see a simple diagram of the model-view-controller triad. Note that the controller has a direct relationship with the view and the model, but the model does not need to know about the controller or the view. The web request will be handled by the controller, and the controller will decide which model objects to use and which view objects to render.
Figure 1.1 The model-view-controller pattern depicted
To begin, we will open up Visual Studio 2008 and create our project. The edition of Visual Studio 2008 makes some difference. You must be using Visual Studio 2008 Professional or a Team Edition sku that has all of the Professional edition’s functionality. The ASP.NET MVC Framework is supported with Visual Web Developer Express as of the Service Pack 1 release, which added web project and class library support. The ASP.NET MVC Framework builds on top of a web application projects, and while it is possible to make it work with Web Sites, the development experience is optimized for use with Web Application Projects.
Note:
You must already have the MVC Framework installed to proceed. The MVC Framework is an independent release that builds on .Net 3.5 Service Pack 1. You can also deploy your application by including the MVC Framework assemblies in the /bin folder of your web application if you need to run on a server with only .Net 3.5 SP1 installed. If you are fond of Reflector (Lutz Roeder’s Reflector: http://www.aisto.com/roeder/dotnet/), you want to be sure to familiarize yourself with the System.Web.Mvc namespace in the System.Web.Mvc assembly.
We’ll begin in Visual Studio 2008 Professional by creating a new ASP.NET MVC Web Application project. When you pull up the New Project dialog, make sure you have .Net Framework 3.5 selected. If you have .Net Framework 3.0 or 2.0 selected, Visual Studio will filter the list, and you won’t see the project template for ASP.NET MVC Web Application.
Stay tuned for more: My feed: http://feeds.jeffreypalermo.com/jeffreypalermo
You will also want to pay attention to my co-authors: Ben Scheirman and Jimmy Bogard.
MLS: 4880240
Price: $219,900
2386 sq ft
4 bedroom
2 bathroom
2-car garage
Formal dining
Private office
Large limestone patio
Sprinkler system
7-foot shower heads
Very high ceilings
Virtual Tour: http://tours.tourfactory.com/tours/tour.asp?t=446809
There are lots of folks in the industry I’d love to work with. If you’d like to work with me, let me know. Headspring is growing quickly, and I need folks who are passionate about agile development with .Net. All Headspring developers report directly to me. We are serious about agile and serious about keeping good people. Personality is just as important as software skill
Agile .NET Developers (senior and higher)
Headspring Systems seeks talented and exceptional Agile .NET Developers. Ideal development experience should include extensive object-oriented design and experience with extreme programming (XP), especially test-driven development. Experience with Scrum, NAnt and NHibernate is a plus.
Headspring Culture
Our work environment is a relaxed one. Our office is open so it gets a little noisy at times but we like the energy this creates. We like to have fun, but we also work hard, we like to have a balanced work life. Excellent medical benefits are also offered. To learn more about our organization, please visit us at www.headspringsystems.com
To apply:
Please send your resume to our recruiter via email: jobs@headspringsystems.com
In your cover, please include your high/low salary requirements and please explain why this role seems like a good match for you. Qualified applicants will be responded to as quickly as possible and by me personally.
We are announcing a 10% discount for early registration that goes to September 15th. Register before August 31, and you’ll receive 10% off the price.
You can also receive a volume discount for sending 3 or more people to the training (10%).
Sign up while the tickets are hot!
Advanced Distributed Systems Design using SOA & DDD with Udi Dahan, The Software Simplist
Monday, October 13, 2008 at 08:00 AM – Friday, October 17, 2008 at 05:00 PM (CT)
Austin, TX
Introduction
Designing large-scale distributed systems is hard. New technologies make it easier to comply with today’s communications and security standards, but don’t auto-magically give you a robust and scalable system. Join Udi for a course packed with the wisdom of companies like SUN, Amazon, and EBay.
Tried-and-true theories and fallacies will be shown, keeping you from making those same costly mistakes today. Communications patterns like publish/subscribe and correlated one-way request/response will be used in conjunction with advanced object-oriented state management practices for long-running workflows. If you enjoy deep architectural discussion, if you are in charge of building a large-scale distributed system, if you want to know more about how the big guys run their systems, this is for you.
About Udi
Udi Dahan is The Software Simplist, recognized by Microsoft Corporation with the coveted Most Valuable Professional award for Solutions Architecture now 4 years running. Udi is a Connected Technologies Advisor working with Microsoft on WCF, WF, and Oslo. He also serves as a member of the Patterns & Practices Advisory Board for the CAB and Prism. He provides clients all over the world with training, mentoring and high-end architecture consulting services, specializing in Service-Oriented, scalable and secure .NET architecture design.
Udi is a member of the European Speakers Bureau of the International .NET Association, an author and trainer for the International Association of Software Architects and a founding member of its Architect Training Committee. He is also a Dr. Dobb’s sponsored expert on Web Services, SOA, & XML.
Presenting at international conferences like TechEd USA, SD Best Practices, DevTeach Canada, Prio Germany, Oredev Sweden, TechEd Barcelona, QCon London, and TechEd Israel – Udi covers in-depth mission-critical topics like durable services, persistent domain models, and multi-threaded occasionally connected clients.
Audience
This workshop is targeted at team leads, application and solutions architects, as well as technologists who are involved in making decisions about the overall system design of software products and projects.
Module 1: Distributed Systems Theory
Decades of distributed systems development have taught us many lessons. In this module we’ll cover many historical mistakes as well as proven best practices for scalable and robust design. Topics include:
• 8 fallacies of distributed systems
• Transactions
Module 2: Coupling: Platform, Temporal, & Spatial
Loose coupling has become the watchword of complex systems development, yet few understand its multiple dimensions. In the module we’ll be covering the three different dimensions of coupling as well as patterns for dealing with them.
• Platform Coupling – XML/SOAP
• Temporal Coupling – Synchronous/Asynchronous
• Spatial Coupling – Endpoints/Topics
Module 3: Asynchronous Messaging Patterns
Although scalability is achieved through the use of asynchronous message passing, more advanced message exchange patterns are required to handle today’s complex integration scenarios. This module will cover the most commonly used patterns:
• One way
• Correlated Request/Response
• Publish/Subscribe
Module 4: Bus & Broker Architectural Styles
Enterprise Service Buses are all the rage these days. In this module we’ll be covering what’s the difference between the Bus architectural style, and the more well-known Broker, found commonly in many EAI projects. Topics will include:
• Architectural advantages and disadvantages
• Technological advantages and disadvantages
Module 5: SOA Building Blocks
One of the goals of SOA is to develop systems which are more closely aligned with Business. In this module we’ll be covering an analysis methodology from moving from the business domain to executable systems that comply with all the principles of loose-coupling.
• Business Services
• Business Components
• Autonomous components & Queues
Module 6: Scalability and Flexibility
In order to enable agility, services must be able to scale up, out, and down quickly. In this module we’ll see how autonomous components can be configured including transactional and durable aspects of message handling.
• Configuring autonomous components
• Scaling up and out
Module 7: Long running processes
The distributed communications patterns wouldn’t be complete without a discussion on orchestration. In this module we’ll see how to manage the state of long-running distributed communication flows as well as:
• Encapsulating process logic
• Advantages & disadvantages of orchestration
Module 8: Service / Autonomous Component Solutions
As developers go to implement autonomous components, guidance is required as to which concepts need to implemented in which project, what dependencies are there between projects, and how to bridge the worlds of messaging, business logic, and reporting. Topics include:
• Messages + Handlers
• Databases
Module 9: Service Layer – Domain Model Interaction
Logic-rich services require the use of advanced techniques for logic componentization. The Domain Model Pattern enforces a high level of Separation of Concerns, yet it must eventually be connected with Service Layer code that supports many concurrent users. In this module, the topics covered will include:
• Domain Model introduction
• Testing Domain Models
• Optimistic, Pessimistic, and Realistic Concurrency Models
Module 10: Creating High-Performance Domain Models
The strong separation between the Domain Model and the database which stores and retrieves its data may enable a high level of testability, yet often causes performance problems. In this module, we’ll see the various aspects impacting the performance of persistence:
• Transactions and Isolation Levels
• Lazy Loading, Eager Fetching
• Databases Tips & Tricks
Module 11: Web Services and User Interfaces
The ease of interacting with users over the web drives the need for service to UI interactions. Also, many integrations require exposing synchronous web services to customers. In this module, we’ll see what is required in both cases:
• ASP.NET 2.0 Asynchronous Tasks
• Rich Internet Applications and Services
• Web Services for integration
Module 12: Smart Client / Service Interaction
The publish/subscribe semantics with which services communicate require smart clients to perform a great deal of background work. Also, certain service contracts lead to more performant clients. In this module, we’ll cover the first part of these interactions:
• Multi-threaded client challenges
• Client-friendly Service Contracts
• Service Agents and Client Repositories
Module 13: Notifications & Smart Clients
After Message Handlers in the Service Layer create or update the relevant Model objects in the client Repository, Supervising Controllers are in charge of getting Views to show the updated data. In this module, we’ll describe the parts and interactions of these flows:
• Client-side Model Objects
• Supervising Controllers
• Views and their Interfaces
Module 14: Commands & Smart Clients
Capturing user intent and synchronization between views are at the core of smart clients. After describing solutions that use Events on the View Interfaces, the Command Pattern will be introduced to further decrease coupling between Supervising Controllers. In this module, we’ll describe the parts and interactions of these flows:
• View Interfaces, and how Entity Cloning affects them
• Supervising Controllers and clone reconciliation
• Commands, and Event-Based programming
The Tarantino project is a collection of libraries and tools to facilitate change management and development
The Tarantino project contains a number of useful components for:
Tarantino is currently being developed and extended. If you would like to contribute, the most welcome patch would be Oracle support for the database migrations. Currenlty, only SQL Server is supported.
Headspring Systems is proud to host Udi Dahan in Austin, TX as he teaches his Advanced Distributed Systems Design using SOA & DDD course. It will be a full week of advanced SOA goodness. Go to the course page for all the details as well as the curriculum outline.
eventbrite_event = “158018638”;
eventbrite_view = “tickets”;
eventbrite_width = “600”;
eventbrite_height = “300”;
http://www.eventbrite.com/static/js/events.js
Many times, I’ve heard that the best thing about IoC is that it enables testability. When dependencies are injected into a class, it’s easy to test that class. Testability is a side-effect of good design. The lack of testability signifies a bad design, but the enable to test a class does not, by itself, signify a good design. The causality is one-way.
Let’s take a look at an example:
public class MissileLauncher{ private INavigator _navigator; public MissileLauncher(){ _navigator = new MissileNavigator(); } public void Launch(){ //get direction guidance from _navigator and launch a missile } }
This can be a good design or bad design depending on your needs. We are coupling to an interface, INavigator, but we are also coupling to a specific implementation class, MissileNavigator.
If MissileLauncher can’t do its job without MissileNavigator, then this coupling makes sense, and the class should be tested together with MissileNavigator. Other examples are operations on domain objects: The logic makes no sense without the Customer object, specifically, so the operation should be tested with the real Customer, and not a mock object.
If, however, MissileLauncher is a concept orthogonal to MissileNavigator, then INavigator adequately illustrates the necessary interaction. In this case, coupling to MissileNavigator is detrimental to our design if the MissileLauncher only depends on the operation exposed by INavigator.
We would change this class to the following:
public class MissileLauncher{ private INavigator _navigator; public MissileLauncher(INavigator navigator){ _navigator = navigator; } public void Launch(){ //get direction guidance from _navigator and launch a missile } }
Here, we have inverted the control over locating or creating the dependency. Now MissileLauncher does not care about the actual class, just that it receives an instance of the interface. With the interface it can do its job. This is a better design if you have determined MissileLauncher’s behavior is orthogonal to the actual MissleNavigator class. Again, you have to make many hard decisions about design. Do you couple. . . or not.
In order to do anything useful in software, you must couple. You must couple to something.
The coupling determines how you will test. If you couple to a concrete class, you will test the code together with that class. If you only couple to an interface, you can test the class with only the interface.
Testability is a by-product of inversion of control, and design is the driving factor to invert the control or retain it. Don’t invert all control just so each class can be tested independently of all other classes. You must decide where coupling is appropriate and where it is not.
Last night I spoke in Austin, TX at the Austin .Net User Group, which is the user group I’ve been leading since 2005. It was the first of 4 user group talks this week. I’m taking one of my Tech Ed 2008 talks out on an INETA tour. I’m representing the INETA speakers bureau and visiting Austin, Wisconsin, North Carolina, and Arkansas.
My topic is as follows. If you are in any of these cities, come on out to the local .Net User Group.
TDD, DI, and SoC with ASP.NET MVC
Spelled out, it is test-driven development, dependency injection, and separation of concerns with Active Server Pages .Net Model View Controller. This talk will dive into how to design a presentation layer using ASP.NET MVC. In today’s industry, TDD, DI, and SoC are proven concepts that lead to more maintainable applications. Along with demonstrating how to use these techniques with ASP.NET MVC, we will discuss just what concerns should be separated. This talk provides a unique perspective on separation of concerns and uses TDD and DI to make it happen. MvcContrib is used in all the demos.
About Jeffrey Palermo
Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is an MCSD.Net , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&M University graduate. Subscribe to Jeffrey’s blog feed here: http://feeds.jeffreypalermo.com/jeffreypalermo
South by Southwest (SXSW) is set for March 13-17, 2009 in Austin, TX. From the website:
” The SXSW INTERACTIVE FESTIVAL celebrates the creativity and passion behind the coolest new media technologies. In addition to panel sessions that cover everything from web design to bootstrapping to social networks, attendees make new business connections at the three-day Trade Show & Exhibition. The newest element of the event is ScreenBurn, which adds specific gaming industry programming as well as a three-day Arcade to the mix.”
Voting has begun for the sessions that have been submitted for the conference. I submitted a session entitled Managing High-Performing Agile Teams. SXSW has a community voting process, so you can go online and vote for the sessions you would like to see at the conference.