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 ?
--
Emmanuel Lecharny
Symas.com
directory.apache.org
pEpkey.asc
Description: application/pgp-keys
