Try our conversational search powered by Generative AI!

Benefits of adding a GUID when declaring PropertyDefinitionTypes through PropertyDefinitionTypePlugIn?

Vote:
 

Hi. I have seen that the PropertyDefinitionTypes are defined without the GUID in the Optimizely documentation (See here, here and here)

Example: Before adding a GUID

using EPiServer.PlugIn;
    
    namespace Site.Models.Pages
      {
        [PropertyDefinitionTypePlugIn]
        public class LocationsProperty : PropertyList<Location> { }
      }

However, we have had an architectural change in our project. And we have had runtime issues after changing the namespace of the PropertyDefinitionType we have created. Because we have moved the PropertyDefinitionType  we have created to a new project inside the same solution.
We have been able to dig into the database and find a fix for that. However, I am wondering how to prevent the issues arise from changing the namespaces in the future related to PropertyDefinitionTypes.

Is it the best practice to use GUIDs in PropertyDefinitionTypes? 
Does it prevent the runtime issues which happen after updating the namespaces of the PropertyDefinitionTypes?

I asked this question because I am not sure whether this is the best practice as all the examples [You can find the links above] related to the PropertyDefinitionTypePlugIn I found in Optimizely documentation are not having a GUID defined.

Thanks :)

#294848
Edited, Jan 17, 2023 14:27
Vote:
 

Since I did not get an answer to this question yet, meanwhile I have tested in my local and verified that adding a GUID to PropertyDefinitionTypes prevent the runtime issues which happen after updating the namespaces.
And because of that, I think that is the best practice of declaring a PropertyDefinitionType. (Someone from Optimizely could verify this)

#294899
Edited, Jan 18, 2023 12:41
Vote:
 

Based on our experience its better to assign GUID. We had issues when upgrading from CMS 11 to CMS 12 where we observed that we had to get a guid from existing DB and assign it to new project to avoid issues. This is just our experience and not from any specific document.

#294993
Jan 19, 2023 17:51
- Jan 20, 2023 7:40
Yes. I also had a look into your forum topic (CMS 11 to 12 Upgrade) and also added a comment to Greg J's answer.
It would be better if this is explicitly defined in Optimizely documentation. Since most of us do not know what is happening inside Optimizely, it makes sense to state that explicitly in the Optimizely documentation. Otherwise, we may blindly follow the steps mentioned and end up in an issue later. (At least this is my perspective of view)
I do not know a reason to not include it in Optimizely documentation as most of the projects will have to upgrade or change the namespaces of the files in their solution at some point in the time.
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.