Posted by & filed under Architecture, FAQ, Help, Restructure101, Structure101.

The name-map is a feature that most users will not require. But, there are certain use cases where its use can be invaluable. For example:

  • If you have a large volume of class to class transformations, you may notice the client reaction time becoming slow. To workaround this use the Java name-map, as it can bypass heavy transform rules with direct class to class mapping at the lowest level.
  • If you can extract a class-to-architecture mapping from another tool, this will avoid the need to re-enter the mapping in (Re-)Structure101.
  • If there are certain classes you’d like to “mark”, e.g. if there are API classes you wish to indicate as not movable, you can do this by adding a prefix or suffix to the class name as a visual indication. E.g. you could map com.myco.MyApiClass to com.myco.API_DO_NOT_TOUCH__MyApiClass

These are just some of the use cases already being used by our customers.

To enable a name map, first create a text file with the from and to class name on one line, separated by a tab character. An example file can be seen if you export Transformations, as it is the same file format. e.g. com.foo.B com.foo.B_DB_CLASS

Then, add the following property to the top of your project file <property name=”name-map-location” value=”path-to-you-class-map-file.txt”/>. And that’s it.

As long as this file is found the client software will attempt to map the classes as you’ve defined.

For the IDE plugin to map the same classes, you must publish a snapshot where a name map was specfied and loaded for it.

Note that this map does not support wildcards.

Leave a Reply

Your email address will not be published. Required fields are marked *