Static vs. Dynamic languages: What I really want

“I want static behavior between assemblies/libraries/packages but dynamic abilities within.” – JeffreyPalermo.com

With C# 4.0, code within method can be dynamic because of the new dynamic keyword.  This is a short post expressing what I want out of C#.

I recently listened to a great debate about the advantages and shortcomings of both dynamic and static languages, and the biggest pain of 100% dynamic languages is that when using a library, you really don’t know what is supports except if the documentation is liberal and flawless.  There are no interface types to describe what properties and methods will be called once you pass the object in.  If the documentation doesn’t cover every API, you are forced to write characterization tests.

The other big challenge is that when working with a dynamic language, you have to keep more of the system in your head in order to program.  You have to remember which object is overriding which method, and what objects have new functionality attached to them.

Both of these points are only an issue between package boundaries.  Within a package, everything is fine because you own all that code.  All the conventions are yours.  This dovetails with the main strength of a static language:  All the APIs are self-describing.  Every method declares types on the arguments.  Objects explicitly implement interfaces.

The problem with static languages is that this rigor is extended within the package as well forcing the programmer to write every method body using the same compiler strictness of typing.

If we can have a dynamic keyword in C# so that code within a method body is dynamic, then some of this might already be achieved.  We’ll have to see.  Public interfaces that are at package boundaries need to be self-describing, from my point of view.  After that, writing dynamic code within controlled boundaries can make things go smoother. 

ASP.NET MVC wins with simplicity, not features

As a follow-up to some ASP.NET MVC comments by Dino Esposito, I want to provide my commentary on why the grassroots of the .Net developer community is so in love with ASP.NET MVC, even though Microsoft marketing isn’t really seeming to push it.  It’s odd, too, because with Entity Framework, the message from Microsoft is clear:  DataSets and Linq2Sql will still be supported. . . but . . . er. . .um, we recommend you start moving to Entity Framework.

Car vs. Motorcycle? Irrelevant analogy, I say

Because of the way the http://asp.net/mvc and other folks(Scott Hanselman) present a car vs. motorcycle analogy, the message is loud and clear:  9 of of 10 of you should be using Web Forms/car.  The remaining 1 psycho with a death wish can ride the motorcycle/MVC.  The problem is that reality is the following:  Web Forms is the 1985 Lincoln TownCar (or even modern cars) where every single function is a physical electric toggle switch, plush comfortable seats and a sunroof.  ASP.NET MVC is a 1950s Chevy.  Every Chevy owner could understand how that car worked because of its simplicity.  With the decked-out Lincoln, you needed to call in expert help if your electronic left mirror adjustment switch stopped working.

Whether Microsoft says it or not, ASP.NET MVC is a much superior IHttpHandler than Web Forms.  I say it in this way because both use the ASP.NET runtime, which has proven very solid over the years.  Because they are both linked to this core interface, they play nicely together.  (In fact, stay tuned for an article about how to utilize MvcContrib’s Portable Areas feature by dropping in a DLL into a Web Forms app to instantly give that site a new section of urls and pages.)

Why is ASP.NET MVC superior?  How can I say this when Web Forms has so many more controls, so many more features?  I say this because it is a framework, not a product.  I build products.  I use frameworks to build products.  I want my platform vendor to provide me with a simple and powerful framework so that I can build killer products for my clients.  Crowding the framework with features actually hurts my ability to achieve my goal.

Web Forms will always have more features than ASP.NET MVC.   ASP.NET MVC will never provide as many features as Web Forms.  Chart control?  Nope.  How about the most basic grid?  I certainly hope not.  In fact, as one of the early and strongest community champions of ASP.NET MVC, I hope a grid never ships with it (MS should concentrate on the framework and let the community and component vendors ship grids).  ASP.NET MVC has such grassroots excitement in the developer community because of the raw simplicity of it.

Simplicity will cause ASP.NET MVC to de facto replace Web Forms.  I’ve said before that Web Forms will continue to power interesting web sites for decades to come.  I am glad for that.  It is a great framework, and I have delivered business critical applications with it.  ASP.NET MVC is the way into the future for ASP.NET, though.  After having a framework with tons of features and many strong control vendors who provide almost any functionality you can think of in a control, we (as in the average joe developer) long for a simpler way.  ASP.NET MVC latches onto some of the strength of Rails and PHP.  It is very easy to understand what is going on.  Very simple.  It doesn’t take an expert to decipher the flow of logic in the pages.  This is simpler to the exercise equipment craze of the 1990s giving way to the rise in popularity of simple running and bicycling that we have seen in the U.S this decade.

Conclusion

Microsoft is not jumping up and down saying:  “You should be using ASP.NET MVC for all your new web applications!”  It’s just the folks who have given the framework a chance who are saying it.

Dino: ASP.NET MVC is MUCH better than MS seems to think

Dino Esposito, from whom many of us have read and learned a great deal over the years, has recently expressed his love for ASP.NET MVC.  Moreover, he has also notice that the message from Microsoft is very tentative about the framework.  Because of the large market share of Web Forms, Microsoft seems hesitant to push ASP.NET MVC as THE NEW VERSION OF ASP.NET for fear that existing customers will worry about being left behind.

I have previously predicted that with Visual Studio 2010, the majority of new ASP.NET projects would use the MVC flavor over the Web Forms flavor.  I stand by that because the IHttpHandler that is MVC is simpler to use and maintain than the System.Web.UI.Page (which is just an IHttpHandler).

Party with Palermo: PDC ‘09 edition – 6 days and counting

image That’s right, folks!  For those of your coming to Microsoft’s Professional Developers’ Conference (PDC), Party with Palermo is going to kick the week off right.  The conference starts on Tuesday, so Monday night, we are going to get down and party to the turntables of DJ Craig.  If you were at the Party with Palermo at Tech Ed,  you remember this DJ and how he had the uncanny ability to get folks like Ted Neward and Sara Ford dancing like it was 199. . . 2009!

image image

Here is the skinny:  Monday night – 7pm-10pm before PDC.  Come to The Mayan, 6 blocks from the convention center in downtown L.A.  Party with Palermo.  RSVP now!

November 16, 2009 – Los Angeles, CA – 7:00PM – 10:00PM

The Mayan (map, website)
1038 South Hill St., Los Angeles, CA 90015
Ph: (213) 746-4287 – (six blocks from the convention center)
Cover charge is 1 business card.  This will get you in the door and register you for the grand prize drawings.

Entertainment provided by:

DJ Craig

  • Free to attend
  • Free drinks
  • Free swag
  • Eat before you come

Sponsors: (find out how to become a sponsor)

KEEP TABS ON http://www.PartyWithPalermo.com — THIS IS WHERE THE INFORMATION WILL BE POSTED.

Subscribe to the Party with Palermo newsletter

Feel free to blog and link back to this site.

Response: "Agile is treating the symptoms, not the disease" by Ted Neward

Ted Neward, whom I’ve known for about 4 years now, wrote a piece calling out all the complexity that is in the line of business software space these days.

This post is not to say that I agree or disagree, but it is a refreshing blog post to read.  I love discussion like this.  As the CTO of a consulting company that embraces Extreme Programming for project delivery, I’m continually trying to get better at delivering high-quality, maintainable software.

When reflecting on what Ted calls out that is necessary for my people to know, I’ll quickly add to the list:

  • · 7zip
  • · aspnetmvc
  • · AutoMapper
  • · cassini
  • · castle
  • · CruiseControl.NET
  • · exceptioneer
  • · FxCop
  • · gallio
  • · msdeploy
  • · mvccontrib
  • · naak
  • · nant
  • · nantcontrib-0.85
  • · nbehave
  • · ncover
  • · ndepend
  • · nhibernate
  • · nunit
  • · rhinomocks
  • · SourceMonitor
  • · structuremap
  • · subversion
  • · tarantino
  • · watin

The funny thing is, we are building tools to make delivering software easier, so we have other things added to the .Net framework.  At some point, Microsoft and Oracle need to take a good look at .Net and Java and see how they can raise the abstraction level a bit so that the technical business analyst can have a hope of a small program.

Just like DRM in the music business has found (>80% of music pirates could not be forced to pay for the music), >80% of technical business analysts will not use .Net or Java for their small little app.  They will walk away and not write the app.  They will instead add just a few more macros to that huge Excel spreadsheet.

Udi Dahan to come deliver his SOA & DDD course in Austin

Udi Dahan is delivering his Advanced Distributed Systems Design (SOA & DDD) course in Austin for the second time.  Headspring is hosting the training and is happy to offer this course for those in Austin and those willing to travel to Austin.

November 30 to December 4 of 2009 are the dates of the training.  Go to the Headspring training page to sign up.  Below is the breakdown of the course.

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 / AC 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: 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

MvcContrib working on Portable Areas

This is a pretty short post, and it is just enough to announce some plans on the MvcContrib roadmap.

Portable Areas

What is a portable area?  As you know, ASP MVC 2 is going to ship with an implementation of areas where an area can either be in in a single project or separate projects.  MvcContrib already has an Embedded View ViewEngine, which lets views be embedded as resources in an assembly.  The next step is to take an MVC2 area, wire in the embedded view engine, and compile it to a single assembly.  Then, you can publish your area as an assembly to distribute any number of controllers and views.  This can be used to distribute multiple pages that all work together.

I expect control vendors to use portable areas to make their rich control suites work with ASP MVC.  After all, when registering the portable area at application start, the routes are essentially being registered.  Even if there are no top-level pages in the area, it would be really easy for a control vendor to supply an area allowing the developer to type:

<%=Html.RenderAction<ControlVendor.SuperGridController>(c=>c.List(Model.Products))%>

The area has multiple controllers and views, and they can be wired into an application in many ways.

Call for participation

If you are interested in participating in the development of Portable Areas within MvcContrib, please join the discuss list and create a GitHub fork of MvcContrib.