I have a System called ‘A’ that holds the objects of itself into data structure by name. Basically System ‘A’ has a function called getObject(obj_name). This function creates an object with the given name, obj_name, if it’s not already exists and then return it otherwise it just return the object.
Now, Program 1 uses System ‘A’ and creates an object called “Program1_Object” using above function (getObject)
Program 2 calls getObject with “Program1_Object” as its argument.
The problem in here is getObject returns Program 1 object to Program 2. I want to add permission to that object that if object is not meant for the caller program returns an error or create a new one for the caller program.
What is a trick behind it?
Thanks
Acould be a simple wrapper for a hash table. Permissions could be implemented with an additional parameter togetObjectstating the permissions of the calling code.