You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2007/04/12 19:12:32 UTC

ModifyDN and move semantic

Hi,

as I changed the interceptors operation to use instances of ServiceContext
instead of multiple parameters, I'm facing a difficult semantic problem with
the modifyDN operation. This operation gather three different semantics :
- a rename operation, if the RDN is changed, but not the base DN
- a move operation if the RDN is not changed but the base DN is changed
- and a move+rename operation if both RDN and base DN are changed

As I can't have two move() operations, because the signatureis now the same
(move(ServiceContext)), so I wanted to rename the method, but which name
using ? ... Another option would be to keep the two move() methods, but
instead of using the ServcieContext interface, to use the specific sub-class
: move( MoveContext ) and move( ChangeContext ), where the MoveContext is
used if the RDN does not change, and the other one if it change.

wdyt ?

-- 
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: ModifyDN and move semantic

Posted by Alex Karasulu <ak...@apache.org>.
So are you suggesting explicit yet different method names for all these
operations rather than using overloads?

Alex

On 4/12/07, Ersin Er <er...@gmail.com> wrote:
>
> As a side note: I prefer single most generic forms for all types of
> the same operations. Having more than one forms of search, moddn
> causes problems when writing complicated services like authorization
> and triggers.
>
> On 4/12/07, Alex Karasulu <ak...@apache.org> wrote:
> > Yeah I like your idea of using a MoveContext and a RenameContext along
> with
> > a MoveAndRenameContext.  This solves the problem quickly but I wonder if
> it
> > is the best option.
> >
> > Alex
> >
> >
> >  On 4/12/07, Emmanuel Lecharny <el...@gmail.com> wrote:
> > > Hi,
> > >
> > > as I changed the interceptors operation to use instances of
> ServiceContext
> > instead of multiple parameters, I'm facing a difficult semantic problem
> with
> > the modifyDN operation. This operation gather three different semantics
> :
> > > - a rename operation, if the RDN is changed, but not the base DN
> > > - a move operation if the RDN is not changed but the base DN is
> changed
> > > - and a move+rename operation if both RDN and base DN are changed
> > >
> > > As I can't have two move() operations, because the signatureis now the
> > same (move(ServiceContext)), so I wanted to rename the method, but which
> > name using ? ... Another option would be to keep the two move() methods,
> but
> > instead of using the ServcieContext interface, to use the specific
> sub-class
> > : move( MoveContext ) and move( ChangeContext ), where the MoveContext
> is
> > used if the RDN does not change, and the other one if it change.
> > >
> > > wdyt ?
> > >
> > > --
> > > Cordialement,
> > > Emmanuel Lécharny
> > > www.iktek.com
> >
> >
>
>
> --
> Ersin
>

Re: ModifyDN and move semantic

Posted by Emmanuel Lecharny <el...@gmail.com>.
Ersin Er a écrit :

> As a side note: I prefer single most generic forms for all types of
> the same operations. Having more than one forms of search, moddn
> causes problems when writing complicated services like authorization
> and triggers.
>
I agree, but in this very case, I tried to do everything within a single 
move() method, but it was far too complex : too many if/then/lese to deal
with each case... The modifyDN has 3 different ementics which are better 
handled with 3 different methods. If there are some commons 
functionnalities in each interceptors, then sole helper method will help.

Emmanuel

Re: ModifyDN and move semantic

Posted by Ersin Er <er...@gmail.com>.
As a side note: I prefer single most generic forms for all types of
the same operations. Having more than one forms of search, moddn
causes problems when writing complicated services like authorization
and triggers.

On 4/12/07, Alex Karasulu <ak...@apache.org> wrote:
> Yeah I like your idea of using a MoveContext and a RenameContext along with
> a MoveAndRenameContext.  This solves the problem quickly but I wonder if it
> is the best option.
>
> Alex
>
>
>  On 4/12/07, Emmanuel Lecharny <el...@gmail.com> wrote:
> > Hi,
> >
> > as I changed the interceptors operation to use instances of ServiceContext
> instead of multiple parameters, I'm facing a difficult semantic problem with
> the modifyDN operation. This operation gather three different semantics :
> > - a rename operation, if the RDN is changed, but not the base DN
> > - a move operation if the RDN is not changed but the base DN is changed
> > - and a move+rename operation if both RDN and base DN are changed
> >
> > As I can't have two move() operations, because the signatureis now the
> same (move(ServiceContext)), so I wanted to rename the method, but which
> name using ? ... Another option would be to keep the two move() methods, but
> instead of using the ServcieContext interface, to use the specific sub-class
> : move( MoveContext ) and move( ChangeContext ), where the MoveContext is
> used if the RDN does not change, and the other one if it change.
> >
> > wdyt ?
> >
> > --
> > Cordialement,
> > Emmanuel Lécharny
> > www.iktek.com
>
>


-- 
Ersin

Re: ModifyDN and move semantic

Posted by Alex Karasulu <ak...@apache.org>.
Yeah I like your idea of using a MoveContext and a RenameContext along with
a MoveAndRenameContext.  This solves the problem quickly but I wonder if it
is the best option.

Alex

On 4/12/07, Emmanuel Lecharny <el...@gmail.com> wrote:
>
> Hi,
>
> as I changed the interceptors operation to use instances of ServiceContext
> instead of multiple parameters, I'm facing a difficult semantic problem with
> the modifyDN operation. This operation gather three different semantics :
> - a rename operation, if the RDN is changed, but not the base DN
> - a move operation if the RDN is not changed but the base DN is changed
> - and a move+rename operation if both RDN and base DN are changed
>
> As I can't have two move() operations, because the signatureis now the
> same (move(ServiceContext)), so I wanted to rename the method, but which
> name using ? ... Another option would be to keep the two move() methods, but
> instead of using the ServcieContext interface, to use the specific sub-class
> : move( MoveContext ) and move( ChangeContext ), where the MoveContext is
> used if the RDN does not change, and the other one if it change.
>
> wdyt ?
>
> --
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com