Tales from the Evil Empire

Bertrand Le Roy's blog

News


Bertrand Le Roy


Add to Technorati Favorites Tales from the Evil Empire - Blogged

Blogs I read

My other stuff

How Orchard works

(c) Bertrand Le Roy I just finished writing a long documentation topic on the Orchard project wiki that aims at being a good starting point for developers who want to understand the architecture, structure and general philosophy behind the Orchard CMS.

It is not required reading for anyone who only wants to write Orchard modules and themes but hopefully it will help people who want to evaluate the platform and start writing patches.

Read it here:
http://orchardproject.net/docs/How-Orchard-works.ashx

Comments

Steve said:

Seems rather complex with a whole new set of terms and languages I'm not familiar with.

Honestly I had a difficult time reading it - ie an object described as 'cheap' at first sounds good but then I'm left wondering what cheap objects really are.

I'm also trying to figure out how normal items we discuss like 'modules' - are they MEF? Are they 'Areas' ?  How does this differ from when we had Sharepoint zones, parts, sites, pages (note the familiar terms) and then previewing,authoring, validating content and how content is delivered ?

I'll go read through it again and see if I can wrap my head around the abstractness of the content.

Thanks

# June 15, 2010 9:05 PM

Bertrand Le Roy said:

@Steve: modules are MVC areas that are extending Orchard. I do not know SharePoint enough to be able to compare concepts.

No object in the document is described as "cheap", they are described as "cheap to create" which just means that instantiating does not consume lots of resources.

The topic is clearly very technical and is not aimed at end users or module developers but rather at core developers or people who want an in-depth understanding of the platform.

Understanding what's in there is in no way a prerequisite to working with Orchard.

# June 15, 2010 9:12 PM

JeroenH said:

This is a very useful article. It's what I missed in order to grasp the fundamental design of Orchard. Thanks for this!

I have one reservation at this point: why exactly do you have to inherit your interface from IDependency for injectable dependencies? It's not a very big problem, but still seems a limitation. Does this leak to module development as well?

# June 16, 2010 3:36 AM

Gauthier Segay said:

Very comprehensive description, hats off for such a nice framework that I will probably love to fiddle with.

A few nitpicks about the document:

in the architecture section, Castle should be replaced by Castle.DynamicProxy, maybe add Castle.Core.Logging.

Castle Windsor link is confusing (as AutoFac is used as the IoC container), link to www.castleproject.org/.../index.html instead?

MVC is a pattern name, better spell ASP.NET MVC

This sentence is not clear: "Similarly, we have route providers, model binders and controller factories whose work is to act like the singletons that MVC expects", I'm not sure ASP.NET MVC is expecting singletons here, although it exposes (not sure of the details) some helpers through the view context, a better wording

In "Anatomy of a content type", the handler description is a bit opaque starting from the second paragraph, although code samples are a good way to clarify, it's not easy to pickup, maybe explaining why you would implement them with real examples would help.

in Localization section, "in a call to T" maybe saying "T method" or provide an example: T("This is a localizable static content").

Logging, uses Castle.Core (Castle itself is really a bunch of frameworks and components, so it doesn't designate something precise)

# June 16, 2010 5:05 AM

Victor Kornov said:

Overall, the doc is pretty good ;) It asnwers the "how" but lacks on the "why" part.

E.g. Dependecny Injection. I'm not sure why the IDepency interface is required. I'm not familiar with Autofac yet the way Orchard requires to specify objects lifetime through IXXXDependency is a bit strange. Clearly, there are cases where an object assumes a certain lifetime to fulfill it's goal. In that case it's a good thing to explicitly specify it's lifetime through an interface. But for other cases where object's purpose doesn't depend so obviously on the lifetime? I.e. it's very much possible that the objects author at inception can't tell for sure the required lifetime. In that case it's better to leave that decision to external component. That adds flexibility (as mentioned above) and makes it less of a breaking change to change objects lifetime later.

# June 16, 2010 6:15 AM

Bertrand Le Roy said:

@JeroenH & Victor: you have to implement IDependency so that we can automatically discover your dependency, rather than requiring explicit registration with the system. It's clearly something that can be done differently but I'd say the reason for this choice is essentially that the ultimate goal here is to build something that has the robustness of modern IoC practices while enabling a layer of simplicity above it. Dependency injection here is the basis for our plug-in system, and we want that to be accessible on two levels.

First, you'll be able to implement strongly-typed interfaces and get your implementation discovered and used by the container and injected into the code requiring them. That's fairly classical and strongly-typed dependency injection.

Second, you'll be able to implement something much fuzzier that looks more like the type of plug-in you'd write in PHP. In that case, you just write something that matches the signature and name of the extensibility point. It's essentially the same thing, but it requires less concepts and is a little more flexible about the form your plug-in takes. It also removes the requirement of having a dependency on the assembly that defines IDependency.

Victor's point about lifetime is definitely valid and it's something we'll gladly address when the need arises. We went for relative simplicity of lifetime management as a first approach. Do you have a scenario in mind?

# June 16, 2010 12:57 PM

Bertrand Le Roy said:

@Gauthier: thanks for the great feedback. I applied most of it. Feel free to edit the document on the wiki if you want to improve some parts further :)

# June 16, 2010 2:30 PM

Gauthier Segay said:

Hi Bertrand, thanks for the head up.

I pulled a fork of orchard here, the solution works quite flawlessly, I was able to run the web site in a short time, nice work on this.

I'd like your team look at a slight change I did on the Orchard Page module codebase (the first one I've looked at), it seems that things could be kept KISSer, also I'm not sure the ViewModel name fits for what we are using these classes for.

One can look at the changes here: code.google.com/.../detail

any opinion on these?

# June 20, 2010 3:57 PM

Bertrand Le Roy said:

@Gauthier: thanks. Could you please submit a patch following the instructions on this page? orchard.codeplex.com/wikipage

# June 20, 2010 7:29 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)