Team Development with Sitecore the Easy way

9

August 28, 2009 by Alistair Deneys

Most of the Sitecore implementations I’m involved in have me working in a team environment. In fact, this is pretty normal for any IT project. Although a team environment has many benefits, there are also some complexities that need to be addressed in terms of keeping the development environment in sync.

There are two things that need to be synchronised across all the development environments; code and data. The code synchronisation issue has been dealt with long ago by using source control. I wish I could say at this point that I haven’t encountered a team not using source control for a long time, but alas I cannot. Realistically I cannot believe that any professional developer would not use source control these days. This is the number one tool required for easier team development for any project.

I also use source control for 1 person projects. Along with synchronisation, source control provides other benefits such as versioning of the code so you can roll back changes, and providing a central location for all code. New dev comes onto the project? Just get the source from here. Old project needs maintenance? Just get the source from here. Original developer left the company? Just get the source from here.

The other part to the synchronisation issue is the data. I’m a strong believer of putting all database related things in source control. Your development database on a SQL server is just an instance of the structure and data you define in script files. Do not treat the database server as the place where your database lives. It should live as scripts in source control. The database on the database server is just a single instance of that database.

Another benefit of storing your schema and data in source control is the ability for accessing the data without a direct connection to the database server. For example, when working from home or a remote location away from the office. If the database scripts are kept in source control it’s straight forward to get the latest versions of the files and create a local copy to work against.

Although I want my data to live in source control as scripts I also am a strong believer of not accessing proprietry databases directly if an API exists. This is the case for Sitecore. Not to mention the complexity of the data stored in Sitecore.

So when working with Sitecore, how do you get your data to live in source control rather than the database? A common practice for Sitecore projects is to create Sitecore packages of the project specific data. This package can then be put in source control. This can also be seen as common practice through many of the shared source projects for Sitecore. Problem here is the package is a zip file, not text so your source control will not try and merge the package if multiple developers have updated multiple items and updated the package independent of each other.

Sitecore 6 introduced item serialization. This allows you to export item data in a text format at the click of a button to disk. And also to import it at the click of a button. This is a much better approach than the package approach. The only drawback to Sitecore 6 item serialization is that media library items cannot be exported in this way, so you’ll still have to drop back to a package for these.

So now we have the data on disk, we can include it in source control. Well… it depends on your project structure how easy this will be. The item data is placed on disk under the data/serialization folder. I don’t like to write my Sitecore code in the same folder that Sitecore runs. I like to separate my custom code from the system I’m building on top of, so in source control I don’t have the Sitecore root at the same location as my dev root. This makes including the serialized items more difficult.

Now let me step down off my soapbox and confess that although I want my Sitecore items in source control, generally I don’t do this due to the reasons listed above. At Next Digital we normally have a shared development database with each developer running their own instance of Sitecore. This normally works quite well due to the fact that this environment is development and each instance of Sitecore (on the dev’s machine) is restarted due to code changes quite often. This restarting means there are minimal issues with caching of the data.

OK, so now for the easy way. I was privileged enough to be included in the beta program for a new team development tool for Sitecore. I would like to introduce you to “Team Development for Sitecore” (or TDS for short). TDS is developed by Sitecore partner Hedgehog Development in North America. It is a plugin for Visual Studio which allows you to serialize and deserialize Sitecore items for your project directly from within Visual Studio. The items can also be added to source control as the items exist in a custom TDS project as text files. Being text files most source control system should have no problem merging changes.

tds item

You’ll notice from the above screenshot that the text format of an item in your TDS project is the Sitecore 6 item serialization format.

TDS also allows synchronising the items in your project with your Sitecore server. You can also select which items to sync and which ones to leave alone.

tds select items

In general you’ll only want to sync project specific items and leave the Sitecore standard items alone.

tds items in project

There are multiple synchronisation options to determine how TDS should handle such cases as when an item exists in the project but not in Sitecore and when an item exists in Sitecore but not in the project.

Another nice feature of TDS is the item designed. Hedgehog built on the concept of the Visual Studio Class designer to provide a similar tool for viewing the relationship between your templates. This is a huge help, especially as Sitecore supports multiple inheritance through templates which can lead to lengthy investigations when trying to work out which template defines which field on an item.

tds item designer

I find it very useful when designing a solution to design and rework the templates in a UML diagram. The item designer at least gives you the view part of this.

Overall I think TDS is a very good start. There’s heaps of potential there, like making the item designer allow updating of templates and relationships. I’m quite eager to see what Hedgehog do next with TDS. Even so, just having the ability to synchronise Sitecore items across multiple locations is worth the price tag.

Advertisements

9 thoughts on “Team Development with Sitecore the Easy way

  1. Tim Ward says:

    Thanks Al! Great Post. This is a question that always comes up with developers new to Sitecore and is a great overview.

  2. Lars Erhardsen says:

    I’ve been trying TDS out, and while finding it quite useful for combining source control with Sitecore items, it proved not fulfill our needs in my company. The thing is, the TDS project wants to deploy every time you do a build, and we have a build server to do that.

  3. adeneys says:

    Thanks Lars,
    Could you get around that issue with a custom build configuration that didn’t build your TDS project on the build server?

  4. Peter Madsen says:

    Lars,

    Alistair is correct. You can create a custom build configuration, or use the configuration manager and uncheck build from the TDS project. If you have additional questions or concerns please feel free to contact us at Hedgehog Development. Your feedback is valuable as we plan our future enhancements to TDS.

    Peter Madsen
    Hedgehog Development

  5. […] Team Development with Sitecore the Easy way « Coffee => Coder => Code adeneys.wordpress.com/2009/08/28/team-development-with-sitecore-the-easy-way – view page – cached #Coffee => Coder => Code RSS Feed Coffee => Coder => Code » Team Development with Sitecore the Easy way Comments Feed Coffee => Coder => Code My New Blog Composite Presentation Inheritance — From the page […]

  6. This is great, just thinking of what could be done in the future. Say a code generation tool that builds you your model objects that work with linq.
    Now that would be nice

  7. Sean Kearney says:

    Christopher,
    While I can’t say too much about this right now I can tell you that Code Generation is on the road map.

    Sean Kearney
    Hedgehog Development

  8. […] Times For Sitecore Developers I’ve just finished reading a very interesting blog post about a new tool for Sitecore developers; Team development for Sitecore […]

  9. Rodrigo Peplau says:

    Amazing post, I have also made my contribution to this theme with good details about setting up environments for a Sitecore team development.

    http://blog.peplau.com.br/en_US/sitecore-environments-for-dev-qa-uat-and-production/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

The views expressed on this blog are solely my own and do not necessarily reflect the views of my employer.
%d bloggers like this: