[DOCU-362] Provide IoC/DI components documentation Created: 20/Dec/12  Updated: 03/Nov/15

Status: Closed
Project: Documentation
Component/s: content
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Joerg von Frantzius Assignee: Antti Hietala
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Currently documentation.magnolia-cms.com doesn't seem to contain documentation on "Components" in the sense of Java objects provided by Dependency Injection.

In particular http://documentation.magnolia-cms.com/reference/configuration.html#Components doesn't say much about what is explained in http://wiki.magnolia-cms.com/display/DEV/Components+in+Magnolia. Also it isn't clear whether the latter is definitive, and it seems to be geared more towards Magnolia employees than developers trying to learn developing for Magnolia.



 Comments   
Comment by Antti Hietala [ 03/Jan/13 ]

Moved Java object component information out of the Configuration article into Module mechanism. Described the basics of dependency injection with a simple example.

The Components in Magnolia wiki page is too technical for end users. Think of it as reference documentation. The Concept IOC in Magnolia wiki page describes how the concept of inversion of control (IoC) was adopted at Magnolia and how dependency injection (DI) was implemented.

Comment by Joerg von Frantzius [ 02/Dec/13 ]

Hi Antti,

IMHO the documentation is missing what can be injected out-of-the-box with Magnolia:

anything configured in info.magnolia.objectfactory.guice.GuiceContextAndScopesConfigurer:
info.magnolia.context.Context
info.magnolia.context.WebContext
info.magnolia.cms.core.AggregationState
info.magnolia.cms.core.Channel
javax.servlet.http.HttpSession
javax.servlet.http.HttpServletRequest
javax.servlet.http.HttpServletResponse

Plus anything with a public no-arg default constructor can be injected, as described in https://code.google.com/p/google-guice/wiki/JustInTimeBindings.

All in all, the http://documentation.magnolia-cms.com/display/DOCS/Module+management#Modulemanagement-Javaobjectcomponents part might deserve its own page, as it gets lost a bit in the page on Modules?

Dependency Injection (DI) aka Inversion of Control (IoC) is very important for writing testable code, which is why this could need some more exposure...

Generated at Mon Feb 12 01:08:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.