← 输入框|github.com|刷新
Skip to content

Creating Intrinsic Objects from Legacy or 3rd party classes #13

Open

Description

@sirinath

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.

Activity

  1. giltene commented on Nov 4, 2015

    @giltene
    Member

    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.

  2. sirinath commented on Nov 4, 2015

    @sirinath
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions