Question
· 5 hr ago

Regarding best practices for integration between different datasets and namespaces.

In some cases, it's necessary to manipulate data from one namespace to another. For example, a routine in the "N1" namespace needs data from the "N2" namespace. In legacy systems (using only globals), it's common to make the global universal, but what about persistent classes? Is this type of globalization also possible?

In the same context, how could I make a persistent class global for all namespaces? The only way I know is by putting it in %SYS. For example, to build a class from the "N1" namespace in the "N2" namespace, I need to use the pipe or the ZN function, but this somewhat reduces the productivity of the IDE (VS Code, Studio...), because the class doesn't exist in the namespace I'm working in, and this affects the autocomplete of methods, attributes, etc.

What would be the best practices for these use cases? Can I build this type of class in %SYS?

Product version: Caché 2018.1
Discussion (3)2
Log in or sign up to continue

If we look to what InterSystems provides as an application like Ensemble(Interoperability) or HealthShare we will find the class defintions exist in the ENSLIB or HSLIB namespace.  Then via Package mapping you will find that Interoperability enabled namespaces or HS enabled namespaces map the package definitions.  For example in the namespace HSEDGE1 we see

which says the classes from these packages are visible to the HSEDGE1 namespace.  

The data for the extent of these classes by default would live in the associated db for the namespace HSEDGE1.

In most cases the data for the extent is not mapped so as to live in a single univeral database but generally speaking it could be, although in the case iof the Ensemble/Interoperability and HealthShare data you shoud not do this.