See below:
Zhong ZHENG wrote:
Hi pluto developers,
i am reading the pluto source code, and here are some questions.
1, Container service interfaces are defined in the SPI. According to the
doc, LogService is mendatory. The goal of the LogService is to create
Logger instances for components, and i found that the Logger interface
extends ContainerService too. That structure seems a little strange to
me. I commented the "extends ContainerService" in the Logger class and
rebuild pluto, and everything goes on well. So, is it necessary that
Logger must extends ContainerService?
The LogService itself extends ContainerService. As a result, when you
remove the explicit implementation of ContainerService, the LogService
implementation still implements the marker interface. I'm not sure what
the original intent of this marker interface was, but you're right, I
don't think there's any technical reason why it must utilize this
appraoch (i.e., there's no code that utilizes the marker interface).
2, The pluto container defines a set of Factory interfaces to create
certain classes, such as classes in the "javax.portlet" package. In the
FactoryManagerService interface, the following method is defined:
public Factory getFactory(Class theClass);
The method signature seems to mean that: get a factory instance that i
can use to create the specified class (theClass). For example, pluto
will call FactoryManagerService.getFactory(RenderRequest.class) to get a
render request factory instance which may be used to create
RenderRequest instances. But...
2.1 In the "org.apache.pluto.util.ObjectIDAccess" class, pluto calls
FactoryManagerService.getFactory(ObjectIDFactory.class) to get an
ObjectIDFactory instance, which may be used to create ObjectID
instances. Is it more logical to get the ObjectIDFactory by calling
FactoryManagerService.getFactory(ObjectID.class)?
Yes, it would. I agree.
2.2 In the "org.apache.pluto.om.ControllerObjectAccess" class, pluto
calls FactoryManagerService.getFactory(ControllerFactory.class) to get a
ControllerFactory instance, which may be used to create Controller
instances. Is it more logical to get the ControllerFactory by calling
FactoryManagerService.getFactory(Controller.class)?
Yes, it would, I agree again.
If you submit a patch to fix these I will apply it. I may also get
around to it myself (but maybe not as quickly). If nothing else, would
you create a JIRA issue for these two items.
Thanks!
David
Thanks in advance for your reply.
Regards