CompiledDomainModel 1.0 released!

Posted by Robin Hermanussen on May 04, 2013 · 2 mins read

This was a little overdue; my Sitecore code generation module, CompiledDomainModel, has been used in many projects and the code has matured enough to justify a 1.0.0.0 version number. A very important addition was made in this release.

Release 1.0.0.0:

  • Added “Platform Mode”, that can be used if generated code needs to be in separate files (e.g. when there are multiple DLL’s where generated code is needed)
  • NuGet support added

Platform Mode

This is a feature that has been requested by several people. If you have multiple projects or logic that is used in several DLL’s, then you need a way to divide the generated classes up into multiple files.

To make this possible, you should first check the “Platform Mode” checkbox on the settings item (/sitecore/system/Modules/CompiledDomainModel/Settings):

Note that the wrapper classes need to be resolved globally when using the platform mode. To make that possible, there is a dependency on the module itself. So you can’t use the “Remove dependencies” function when you want to use the platform mode.

If you generate the code now, you’ll see that a comment is generated:

As is explained, you must now make url’s to generate code that is specific to your project. In this case, you could generate code for the platform project and the specific “SomeProject” project. Using the following url’s, you can do that:

  1. http://sitecoredemo/sitecore/shell/Applications/CompiledDomainModel/CodeGenerator.aspx?platformsets=Core PlatformTemplatesSet PlatformFixedPaths
  2. http://sitecoredemo/sitecore/shell/Applications/CompiledDomainModel/CodeGenerator.aspx?platformsets=SomeProjectTemplatesSet SomeProjectFixedPathsSet

These url’s will only generate the code for the DomainObjectSets and FixedPathSets (check the documentation for an explanation about these sets) that are referenced in the url.

NuGet support

You can now install CompiledDomainModel through NuGet. I based the package on this excellent article.

Steps:

  1. You need to have Sitecore Rocks installed in Visual Studio
  2. You need to connect your project to your Sitecore website
  3. Open the Package Manager Console and run Install-Package CompiledDomainModel

Of course you are not required to install CDM this way. You can still use the regular package on the Releases page.

Happy CDM-coding!