Moved class (extension point)

From BioUML platform
Jump to: navigation, search
Identifier
ru.biosoft.access.movedClass
Plugin
ru.biosoft.access
Since
0.9.4

Motivation

Sometimes it's desirable to rename the Java class or move it to another package/plugin. Usually this operation can be easily performed via IDE refactoring tools. However some classes are referred from the configuration files, collections and so on and it's quite hard to replace all old name occurences on all the living servers.

Usually the classes are loaded via CollectionFactory.loadClass methods or using the ClassLoader returned by CollectionFactory.getClassLoader which actually also uses loadClass method. Thus these methods were changed to allow loading the moved classes by their old names if old names were properly registered via this extension point.

Configuration Markup

<!ELEMENT class>
<!ATTLIST class
     name        CDATA #REQUIRED
     oldNames    CDATA #REQUIRED
>
name
Current name of the class
oldNames
Comma-separated list of old names the class had

Notes

  • If the class was moved to another plugin, this extension must be registered in the plugin the class is located now.
  • It's still preferred to change all configuration files where class name occurs. Use this extension point only if replacing the class name in all the files is hard or impossible. And even if you use this extension point, try to use new class name in as many places as possible.

Example

<extension point="ru.biosoft.access.movedClass">
   <class name="ru.biosoft.bsa.AnnotatedSequence" oldNames="ru.biosoft.bsa.Map"/>
</extension>  

This example informs BioUML that former class ru.biosoft.bsa.Map was moved to ru.biosoft.bsa.AnnotatedSequence.

Personal tools
Namespaces

Variants
Actions
BioUML platform
Community
Modelling
Analysis & Workflows
Collaborative research
Development
Virtual biology
Wiki
Toolbox