|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001485||ITK||public||2005-01-14 13:35||2009-04-07 06:44|
|Assigned To||Bill Lorensen|
|Target Version||Fixed in Version|
|Summary||0001485: Need a standard deprecation mechansim|
|Description||We need a standard deprecation mechanism to remove/update old API and classes.|
This issue is table for the SPIE'05 ISC meeting.
Possible options from Brad's email:
The use of itkWarningMacro to deprecate the Get_vnl_vector methods in Point, Vector, and CovariantVector will not work. Using the warning macro requires there to be a TypeMacro in the class definition. The type macro is intended only for subclasses of LightObject. It adds virtual functions (and therefore a vtable pointer), which is something we don't want for these small classes.
While it is easy to rip out this code we need a different deprecation mechanism. We could do something similar to what was recently done in VTK. This would mean adding two CMake options: ITK_LEGACY_SILENT and ITK_LEGACY_REMOVE. By default we would setup some kind of warnings (compile time and/or runtime) for deprecated methods. If the user builds ITK with ITK_LEGACY_SILENT set to ON it would silence the warnings. If the user builds itk with ITK_LEGACY_REMOVE then the legacy code will be removed completely resulting in errors in code trying to call it. Deprecating a method would look like this:
// In itkPoint.h:
// In itkPoint.txx:
* Return a vnl_vector_ref
template<class T, unsigned int TPointDimension >
vnl_vector_ref< T >
::Get_vnl_vector( void )
return vnl_vector_ref< T >( TPointDimension, this->GetDataPointer());
The ITK_LEGACY and ITK_LEGACY_REPLACED_BODY methods would be defined appropriately depending on the settings of ITK_LEGACY_SILENT and ITK_LEGACY_REMOVE. The ITK_LEGACY_REPLACED_BODY macro would use itkGenericOutputMacro to print a deprecation message. There would also be a macro called ITK_LEGACY_BODY to print a message when the method was removed but not replaced. I prefer to make these macros uppercase instead of itkXXXMacro format because it makes the code stick out as legacy rather than implemented by a macro.
|Tags||No tags attached.|
Lydia Ng (developer)
|Triaged 8/5/05 tcon. Assigned to Bill L.|
Luis Ibanez (manager)
needs more thinking.
To be addressed during WA10
Marius Staring (developer)
|2007-09-18 11:45||Luis Ibanez||Note Added: 0009082|
|2009-04-07 06:44||Marius Staring||Note Added: 0015945|
|2009-04-07 06:44||Marius Staring||Status||assigned => closed|
|2009-04-07 06:44||Marius Staring||Resolution||open => fixed|
|Copyright © 2000 - 2018 MantisBT Team|