-
Notifications
You must be signed in to change notification settings - Fork 16
Object name change and associated custom create method
In the Audience_oM I want to change the object name for ProfileParameters
to TierProfileParameters
. There are two Create
methods that will also need to be upgraded. This page describes the steps to achieve that.
-
Capture the JSON string of the object to change as described here.
-
Set up a simple file with the auto generated object create method component and related methods that the changes will impact:
-
Use the
VersioningKey
component to get the string that will later be used for the thePreviousVersion
Attribute that I will add to the affected methods. -
Copy the output of
VersioningKey
and paste into a text editor.
-
Change the object name and the file name for this object.
-
In the Engine and oM projects replace all instances of the old name with the new name.
I'm using find and replace for the renaming - care should be taken here.
-
Check the solution builds.
-
Create and add the versioning JSON file to the project. See here for the content of an empty
Versioning_XX.json
file. -
Add the key value pairs to describe the
ToNew
andToOld
upgrade / downgrade..
-
At this we can rebuild the solution and rebuild the
Versioning_Toolkit
. -
First I'll check the upgrade using the json string and
ToNewVersion
: -
If this fails double check all the steps above.
-
Open Rhino and the simple test file.
-
We'll see the auto generated create method has correctly upgraded, but the others show errors:
-
I need to add the
PreviousVersion
attribute to ensure the methods are upgraded. -
The text we saved earlier looks like:
BH.Engine.Audience.Create.ProfileParameters(System.Double) BH.Engine.Audience.Create.ProfileParameters(System.Double, System.Double, System.Double, System.Double, System.Int32, System.Double, BH.oM.Humans.ViewQuality.EyePositionParameters, BH.oM.Audience.PlatformParameters)
-
I'll use the first of those two as arguments to the
PreviousVersion
attribute which will be added to the first method like this: -
And adding the
PreviousVersion
attribute to the second method with more arguments will look like this: -
For compliance I will also change the name of the file containing those methods to match the renamed object type they return
TierProfileParameters
. -
We can now rebuild the solution and the
Versioning_Toolkit
and check again if this has worked.
-
Introduction to the BHoM:
What is the BHoM for?
Structure of the BHoM
Technical Philosophy of the BHoM -
Getting Started:
Installing the BHoM
Using the BHoM
Submitting an Issue
Getting started for developers -
Use GitHub & Visual Studio:
Using the SCRUM Board
Resolving an Issue
Avoiding Conflicts
Creating a new Repository
Using Visual Studio
Using Visual Studio Code -
Contribute:
The oM
The Engine
The Adapter
The Toolkit
The UI
The Tests -
Guidelines:
Unit convention
Geometry
BHoM_Engine Classes
The IImmutable Interface
Handling Exceptional Events
BHoM Structural Conventions
BHoM View Quality Conventions
Code Versioning
Wiki Style
Coding Style
Null Handling
Code Attributes
Creating Icons
Changelog
Releases and Versioning
Open Sourcing Procedure
Dataset guidelines -
Foundational Interfaces:
IElement Required Extension Methods -
Continuous Integration:
Introduction
Check-PR-Builds
Check-Core
Check-Installer -
Code Compliance:
Compliance -
Further Reading:
FAQ
Structural Adapters
Mongo_Toolkit
Socket_Toolkit