Question
· Jul 18

Finding all usages of deprecated classes and methods

Hi folks,

We are in the process of migrating from Ensemble to IRIS.

After the migration I would like to find all usages of deprecated classes and methods in all of our code. This is to align with the changes in package like %SYSTEM.SQL for example.

Is there an easy way to do this, or maybe a tool that can assist?

Thanks.

Discussion (7)3
Log in or sign up to continue

I think it's possible to do this using our Yuzinji tool. Here's my idea:

  1. Go to https://structure101.com/downloads/, fill in your details, and download Structure101g Studio (S101g) for your desktop platform (one of the 3 icons circled red below):
  2. Read the instructions in https://structure101.com/help/generic/flavors/yuzinji/index.pdf to install Yuzinji into S101g, then to add Yuzinji's server-side component to your InterSystems server.
  3. Analyze all your classes and load the results into Structure101g Studio.

But how to identify which deprecated methods or classes are being referenced?

S101g has facility for tagging items on its diagrams. Its "Tag" menu can also export and import a list of tags.

  1. Tag an arbitrary class and an arbitrary method.
  2. Export your tags.
  3. Examine the file.
  4. Write a SQL query to list deprecated classes: select ID from %Dictionary.ClassDefinition where deprecated=1 order by ID  
  5. Format the output to match the structure of the exported tags file, and write this to a file. I'm leaving this as an exercise for the reader.
  6. Import the file into S101g
  7. Repeat previous steps to create a tags file for deprecated methods.
  8. Explore your diagrams to pinpoint the tagged (and therefore deprecated) items.

I came up with a better technique for using Yuzinji and Structure101g Studio to reveal which deprecated classes an app's codebase uses. Here's a screenshot showing the results for the Web Terminal 4.9.6 package on IRIS 2024.1

I adapted the tagging technique to identify the use of deprecated methods in non-deprecated classes. In the case of the Web Terminal codebase, no such usage was found.

If anyone reading this is interested in trying this on your own codebase please contact me through DC's DM facility, or email info@georgejames.com