Lightweight Object Conversion to Heavyweight Instance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The duplication of stored class object instances for objects that inherit from the same class leads to inefficient use of memory and storage space, particularly when storing objects in a database.
Innovation Solution
Implementing a system where a sharable type serves as a parent for multiple lightweight type objects, allowing only a single copy of the sharable type and its instance to be stored, rather than duplicating copies for each lightweight type composite object, and enabling conversion of heavyweight instances to lightweight instances while preserving performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If class object instances are stored for each object that inherits from the same class, then each object can access its class behavior and data, but memory and storage space are inefficiently used due to duplication
Solution Approach 1:
Multiple objects that inherit from the same class share a single instance of the parent class in memory. Instead of each object having its own copy of the parent class instance, they all reference the same shared instance, thereby reducing memory consumption while maintaining access to class behavior and data.
Solution Approach 2:
A single parent class instance serves multiple child objects simultaneously. The shared parent class instance provides class behavior and data to all objects that inherit from it, making the parent class instance universal and multi-functional across multiple child objects.
2Quantity of substance
If a single sharable type instance is shared among multiple lightweight objects, then memory and storage efficiency improves, but system complexity increases due to conversion mechanisms
Solution Approach 1:
When a lightweight object needs to access or modify parent class data, the system creates a temporary copy of the shared parent class instance specifically for that lightweight object. This copy mechanism allows the lightweight object to interact with what appears to be a full heavyweight instance without actually duplicating the shared instance in memory.
Solution Approach 2:
The conversion mechanism acts as an intermediary between lightweight objects and the shared parent class instance. It translates operations on lightweight objects into operations on the shared instance, managing the complexity of sharing while maintaining the illusion of full instance ownership for each lightweight object.
Data Source
AI summary
Processing an object that shares a parent with another object is disclosed. An indication is received with respect to an object that shares a parent object instance with one or more other objects that a change associated with the object is to be made to a data comprising the shared parent object instance. The parent object instance is cloned to create a new parent object instance. The new parent object instance is designated as the parent of the object instance.


