directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FC-25) Improve the way Factories create instances
Date Tue, 25 Nov 2014 16:58:12 GMT

     [ https://issues.apache.org/jira/browse/FC-25?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Lecharny updated FC-25:
--------------------------------
    Description: 
Currently, the various Mgr factories are creating instances for Mgr depending on the type
of access we want (basically, direct access or via REST).

We can imagine that we may have more kind of access in the future (remote, SOAP yukkk, ...
)

But in any case, I think we can simplify the way we create instances :

{code}
accessClassName = AccessMgrImpl.class.getName();
AccessMgr accessMgr =
(AccessMgr)ClassUtil.createInstance(accessClassName);
{code}

could be written :

{code}
AccessMgr accessMgr = new AccessMgrImpl();
{code}

We know everything about the class, and we don't even have to pull a constructor FQCN from
the configuration, the only thing is that we will create a new instance depending on some
configuration parameter.

(this is of course when the config does not provide the class name to instanciate)

I also have some concern about the fact that we may want to mix REST and other kind of access.
Atm, either we have a REST access, or not, but it's global and can't be changed, as the IS_EST
flag is static and final. Each context might access the Mgr in different ways (at least, this
is my understanding, even if I'm pushing it a bit too far).

Does it sound reasonnable ?


  was:


Currently, the various Mgr factories are creating instances for Mgr depending on the type
of access we want (basically, direct access or via REST).

We can imagine that we may have more kind of access in the future (remote, SOAP yukkk, ...
)

But in any case, I think we can simplify the way we create instances :

accessClassName = AccessMgrImpl.class.getName();
AccessMgr accessMgr =
(AccessMgr)ClassUtil.createInstance(accessClassName);

could be written :

AccessMgr accessMgr = new AccessMgrImpl();

We know everything about the class, and we don't even have to pull a constructor FQCN from
the configuration, the only thing is that we will create a new instance depending on some
configuration parameter.

(this is of course when the config does not provide the class name to instanciate)

I also have some concern about the fact that we may want to mix REST and other kind of access.
Atm, either we have a REST access, or not, but it's global and can't be changed, as the IS_EST
flag is static and final. Each context might access the Mgr in different ways (at least, this
is my understanding, even if I'm pushing it a bit too far).

Does it sound reasonnable ?



> Improve the way Factories create instances
> ------------------------------------------
>
>                 Key: FC-25
>                 URL: https://issues.apache.org/jira/browse/FC-25
>             Project: FORTRESS-CORE
>          Issue Type: Improvement
>    Affects Versions: 1.0-RC27
>            Reporter: Emmanuel Lecharny
>             Fix For: 1.0.0
>
>
> Currently, the various Mgr factories are creating instances for Mgr depending on the
type of access we want (basically, direct access or via REST).
> We can imagine that we may have more kind of access in the future (remote, SOAP yukkk,
... )
> But in any case, I think we can simplify the way we create instances :
> {code}
> accessClassName = AccessMgrImpl.class.getName();
> AccessMgr accessMgr =
> (AccessMgr)ClassUtil.createInstance(accessClassName);
> {code}
> could be written :
> {code}
> AccessMgr accessMgr = new AccessMgrImpl();
> {code}
> We know everything about the class, and we don't even have to pull a constructor FQCN
from the configuration, the only thing is that we will create a new instance depending on
some configuration parameter.
> (this is of course when the config does not provide the class name to instanciate)
> I also have some concern about the fact that we may want to mix REST and other kind of
access. Atm, either we have a REST access, or not, but it's global and can't be changed, as
the IS_EST flag is static and final. Each context might access the Mgr in different ways (at
least, this is my understanding, even if I'm pushing it a bit too far).
> Does it sound reasonnable ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message