[MAGNOLIA-5726] Use IoC to set a custom ClassFactory Created: 25/Mar/14  Updated: 04/Mar/19

Status: Open
Project: Magnolia
Component/s: core
Affects Version/s: 5.2.3
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Federico Grilli Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLGROOVY-114 CLONE - ClassNotFoundException when t... Closed
relation
is related to MGNLGROOVY-113 ClassNotFoundException when trying to... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty

 Description   

Before IoC was introduced in Magnolia, the way to replace the DefaultClassFactory with a custom one was by means of a Magnolia SystemProperty which info.magnolia.objectfactory.Classes would check via its getCurrentlyConfiguredClassName() method. Such property could be set by modules in the module descriptor e.g.

<properties>
    <property>
      <name>info.magnolia.objectfactory.ClassFactory</name>      
      <value>my.module.MyClassFactory</value>
    </property>
</properties>

Now, since we have IoC support in Magnolia, this way of configuring components has become legacy (see http://wiki.magnolia-cms.com/display/DEV/Components+in+Magnolia#ComponentsinMagnolia-Legacy), yet Classes keeps on using it to instantiate the desired ClassFactory implementation. Besides that, info.magnolia.cms.core.SystemProperty has been deprecated too in the meantime.
All the above premise to say that we should use IoC in this case too and no longer rely on properties.


Generated at Mon Feb 12 04:07:49 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.