Menu

#3 make private components protected in JKad

open
2
2010-05-25
2010-05-22
Steve J
No

I am currently working on a academic project experimenting a new approach for tuning privacy and performance in P2P systems. I am using JKAD as the base for the test software and I can say it's amazingly well written. The only problem is that adding functionality without modifying the JKAD code is really painful.

The problem seems to come from the fact that singleton components are referred in other classes as private, which complicate the use of a derived classes.For example, if I want to use a subclass of kad.Kad, I have either to change KadUDPConnection in the Jar file, or copy the whole source file only because of the unique call Kad.getSingelton().receivePacket(rawPacket) .

If you see the potential issues I am talking about, I can contribute to the project to make the small changes needed to fix it.
Regards, aureshy

Discussion

  • Steve J

    Steve J - 2010-05-23

    I just realized that singleton classes can't be sub-classed.Never mind.

    I can propose a wrapper approach to allow creation of different form of the some singleton though

     
  • Dmitry Obada

    Dmitry Obada - 2010-05-23

    Hello,

    There is no KadUDPConnection class in our source code, probably you refer to http://jmule.org/files/jkad-alpha-0.1.tar.gz, this is a very old experimental implementation of kad, the things has been changed a lot over time since then. We do not maintain that source code anymore. Take a look at the package org.jmule.jkad from the main source code of JMule

    JKadManager is written as a part of JMuleCore, for performance reasons these components strongly depend on each other and the only way to add a new core functionality is to modify the source code of JMule core. Through "core functionality" I mean something related do eDonkey2000 protocol, traffic encryption, security, kad, etc

    - javajox, JMule developer

     
  • Dmitry Obada

    Dmitry Obada - 2010-05-23
    • status: open --> closed
     
  • Dmitry Obada

    Dmitry Obada - 2010-05-25

    The JMule core has been designed to allow such things that you are talking about. Now each manager of JMule is a singleton, but can be easily transformed into a factory pattern. In other words each manager can have many implementations, the given implementation will be returned when certain conditions will be met

    Remark : this ticket has been reopened per user request

     
  • Dmitry Obada

    Dmitry Obada - 2010-05-25
    • priority: 5 --> 2
    • status: closed --> open
     
  • Dmitry Obada

    Dmitry Obada - 2010-05-25
    • labels: --> JMule core design
    • assigned_to: nobody --> javajox
     
  • Steve J

    Steve J - 2010-05-26

    version of JkadManager singleton with the change proposed

     
  • Steve J

    Steve J - 2010-05-26

    The interface defining factories which creates JKadManager Objects

     
  • Steve J

    Steve J - 2010-05-26

    Like you said, I saw that almost all components can be modified to allow different implementations. In the attached file, there is one example, for the JKadManagerSingleton.

    The good thing is that with the way you wrote your code, no changes will be needed in the other classes.

    cheers,aureshy

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.