Why I like PropertyGroups

In my current project some of our EPiServer pages types can undergo a review process. There are a bunch of meta data connected to this process that we store as proeprties on the page. The problem is that even though we use PageTypeBuilder (and can utilize inheritance) the pages do not share a common base. Instead of going down the ThisPageHasThisAndThatButNotSomeOtherThingPage path we decided that we had to eat the sour grapes and simply add these properties to all the different pages that can be involved in the review process.

Enter PropertyGroups

With PropertyGroups all these review related properties can be “hidden” in a property group and thanks to that we can remove about 300 lines of (duplicated) code and get a model that’s so much easier to work with and maintain. Not to mention how nice it feels to remove unneeded code.

Since the site has been live for a while we obviously already had properties that were to be replaced with the property groups ones. Luckily another feature in PTB 2 solved that problem quite easy. But that’s for another post…