Contents tagged with MVC
-
The Orchard Way
An order for an electric conversion of a vintage Porsche just arrived at Greg’s workshop. He follows a script that will implement the transformation of the car. He looks at the order, and sees that the customer bought the 70kWh battery. He picks up the right number of cells, and re-orders more to refill the stock. The batteries are secured in the trunk. Then, he removes the car’s engine, and disposes of it. He fits the electric motor in its place, and proceeds to route wires from the trunk to the engine’s compartment. The control system is then assembled. All these operations are done sequentially by Greg. In a few weeks, the car is ready.
Meanwhile, a few kilometers away, another order for a brand new electric car arrives at Elon’s factory. It should be an obsidian black metallic all-wheel drive with a 85kWh battery, panoramic roof, silver cyclone wheels, black leather seats, carbon fiber décor, black alcantara headliner, autopilot, and subzero weather package. That’s a lot of little independent details.
-
ASP.NET v.next’s killer features are already here
ASP.NET v.next is definitely an interesting beast. It’s open-source, developed in the open, and the team has clearly studied the competition, Node.js in particular, very closely. Its killer features, however, the ones that may be hardest to reproduce by others, are not new features: we already have them.
-
Reducing coupling with dynamic languages
I’m learning Node currently, after years of doing ASP.NET MVC, and a bit of Python on a couple of projects. There are lots of habits to shake off, and there are things that I miss (such as ASP’s outstanding model binding), but there is also a very liberating power in JavaScript, that lets you do things in a much more straightforward and even cleaner way than you would otherwise. There’s a lot less ceremony, and you can focus on what counts. One thing that keeps astonishing me is how I can make my Node modules work together without coupling them.
-
Cleanly getting a WebAPI action URL
Whenever you need to get the URL of a ASP.NET MVC action, you should use Url.Action (where URL is an instance of UrlHelper), and never hard-code the URL. This way, the URL is dynamically constructed from the available information in the Url.Action parameters and in the route table. If the route is changed, the results of the Url.Action call will change accordingly, and everything will continue to work. The same principles, of course, apply to WebAPI actions.
-
Referencing server-generated fields in script
I had to fix a bug today in somebody else’s code that was caused by some Javascript referencing an element by id. The problem was that this id was assumed by the script to be “#Parameter1” whereas the server-side code generating it was:
-
Strongly-typed HTML helpers in Orchard shapes
Orchard uses dynamic objects called shapes as view models. It happens commonly that you’ll want to use strongly-typed HTML helpers such as Html.TextBoxFor from within a shape’s template. Unfortunately, this is not possible: those helpers rely fundamentally on the model being strongly-typed, because they need to be able to infer the properties of the object from the Lambda expression passed as a parameter of the helper, but the compiler will refuse to compile Lambda expressions on dynamic objects. As I understand it, this is because the compiler can’t infer enough information about the object at compile time. This is all regrettable but that’s how things are.
-
The CMS ecosystem and Microsoft
CMS is extremely important strategically for any web company. About 35% of web sites use a CMS, and the top ones are all PHP (WordPress on its own is more than 20% of all web sites). In other words, if you care about the market share of your web platform, you need a good CMS running on it.
-
A quick look at what’s new in Orchard 0.8
We shipped Orchard 0.8 on Monday and it’s the last release we will make before 1.0, which is scheduled for January 2011. We think it’s a pretty nice release in that it wraps up the UI story for the platform.
-
Orchard 0.5 is out
Before I joined Microsoft seven years ago, I had spent a couple of years building a Web CMS. It wasn’t open-source unfortunately but the experience convinced me that most public-facing web sites would shortly use some form of CMS. I also forged strong opinions about the right level of component granularity that a CMS must implement.
-
RSS feeds in Orchard
When we added RSS to Orchard, we wanted to make it easy for any module to expose any contents as a feed. We also wanted the rendering of the feed to be handled by Orchard in order to minimize the amount of work from the module developer.