On Tue, Sep 11, 2018 at 3:49 PM, Emmanuel Lécharny <[email protected]>
wrote:

>
>
> Le 11/09/2018 à 11:53, Kiran Ayyagari a écrit :
> > I propose to convert the classes PartitionReadTxn and PartitionWriteTxn
> > to interfaces so that new Txn implementations need not be restricted to
> > Java inheritance's single parent restriction.
> >
> > These classes currently do not hold any logic so making such a change
> will
> > not
> > break the existing code in the trunk.
> >
> > Please let me know if there are any objections to this.
>
> Actually, the problem is that the PartitionReadTxn class maydo nothing,
> but it has to be instanciated at some point, something thatis quite hard
> to do with an interface ;-)
>
>
> Now, the current logic is not necessarily the best.
>
> We could draw a better hierarchy, like :
>
> (PartitionTxn) o----------------- [[AbstractPartitionTxn]]
>       o                                     ^
>       |                                     |
>       +-- (PartitionReadTxn) <--- [PartitionReadTxnImpl]
>       |                                     ^
>       |                                     |
>       +-- (PartitionWriteTxn) <-- [PartitionWriteTxnImpl]
>
> where PartitionTxn, PartitionReadTxn, PartitionWriteTxn are interfaces,
> with an abstract class that implement the common methods and Impl for
> the needed instanciation.
>
> wdyt ?
>
I just created additional impl classes after converting them into
interfaces. I do however think that it would
be better to distinguish a read txn from a write txn my using an internal
flag, but that will be a bigger change and subject to another thread.

>
>
> --
> Emmanuel Lecharny
>
> Symas.com
> directory.apache.org
>
> Kiran

Reply via email to