You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Creating Intrinsic Objects from Legacy or 3rd party classes #13
Some times you do not have control over the coding of certain objects. Is it possible to give a mechanism which can intensify without having to add special constructs. Perhaps they can be injected through byte-code manipulation.
Perhaps thee ability to intensify object fields to n levels deep, or from certain packages, etc.
In the current design, you can declare @intrinsic member fields of any constructible Java class of a fixed size (including arrays with a fixed length declared with @Intinsinc(length=Const) ). This inherently includes legacy and 3rd party classes. The only types of Java object that cannot be @intrinsic within other classes are ones that do not get constructed: e.g. types that are "manufactured" by factories.
Since declaring an object of class A to be @intrinsic to another object of class B is inherently an internal design consideration of class B, declaring @intrinsic is necessarily done within the implementation of B. Any "legacy" implementations of B would need to be modified i you wanted to make some of it's internal members @intrinsic. I don't think that this should be done (or allowed) via external control, code weaving, or other outside-of-private-implementation mechanisms, since @intrinsic is [intentionally and carefully] restricted to private final fields.
You consume a lot more code than what you write and most of the candidates to intensify in any project will be in 3rd party libs. Leaving aside philosophical consideration this is the pragmatic path to take as it is not possible to manually edit code from all your dependencies, if not in the core at least as an extension project, where you can get an intrincified version of an object at creation and / or specify all instances of class X should be intrinsic.
Also you might need a way to detect and support factories.
Activity
giltene commentedon Nov 4, 2015
In the current design, you can declare @intrinsic member fields of any constructible Java class of a fixed size (including arrays with a fixed length declared with @Intinsinc(length=Const) ). This inherently includes legacy and 3rd party classes. The only types of Java object that cannot be @intrinsic within other classes are ones that do not get constructed: e.g. types that are "manufactured" by factories.
Since declaring an object of class A to be @intrinsic to another object of class B is inherently an internal design consideration of class B, declaring @intrinsic is necessarily done within the implementation of B. Any "legacy" implementations of B would need to be modified i you wanted to make some of it's internal members @intrinsic. I don't think that this should be done (or allowed) via external control, code weaving, or other outside-of-private-implementation mechanisms, since @intrinsic is [intentionally and carefully] restricted to private final fields.
sirinath commentedon Nov 4, 2015
You consume a lot more code than what you write and most of the candidates to intensify in any project will be in 3rd party libs. Leaving aside philosophical consideration this is the pragmatic path to take as it is not possible to manually edit code from all your dependencies, if not in the core at least as an extension project, where you can get an intrincified version of an object at creation and / or specify all instances of class X should be intrinsic.
Also you might need a way to detect and support factories.