[MAGNOLIA-3086] Module instances could be proxies too Created: 16/Feb/10  Updated: 16/Mar/12  Resolved: 09/Mar/12

Status: Closed
Project: Magnolia
Component/s: core, updatemechanism
Affects Version/s: None
Fix Version/s: 4.5

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MAGNOLIA-2569 Components: introduce dependency inje... Closed
relation
is related to MAGNOLIA-2553 FactoryUtil: should return a proxy ob... Closed
is related to MAGNOLIA-3444 Observed / proxied / c2b objects coul... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

Since MAGNOLIA-2553, we realize how useful it would be for module instances to also be proxies. They could be kept around (and/or injected) without worrying about whether the configuration was changed/replaced.



 Comments   
Comment by Magnolia International [ 27/Jan/11 ]

With the introduction of IoC this might be a little more complicated than anticipated.

  • Module classes need to be instantiated by the IoC container to get their dependencies injected
  • We currently use c2b to populate those.

The tricky part seems to be that if we simply register those using the current ObservedComponentAdapter, we can't really make it work (since we register the adapter in pico, we can't let c2b ask a new instance - since that would retrieve the ObservedComponentAdapter again, resulting in a stack overflow.

One possible course of action would be to "hide" the c2b calls in the adapter itself using org.picocontainer.behaviors.PropertyApplicator or org.picocontainer.behaviors.Decorated - to be investigated ..

Comment by Tobias Mattsson [ 25/Nov/11 ]

Changed fix version to 4.5 since there is commits.

Comment by Tobias Mattsson [ 09/Mar/12 ]

This pico implementation was replaced when we switched to guice. Module properties was restored in r50148, see issues SCRUM-451, MAGNOLIA-3457, MAGNOLIA-3538

Comment by Philipp Bärfuss [ 16/Mar/12 ]

We are currently not using deep proxies. This means it is save to keep a reference to a module object but not to keep a reference to any sub bean. To achieve this we needed a deep proxy similar to what we do in the bean merger. But this is out of scope for the moment.

Generated at Mon Feb 12 03:43:03 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.