Menu

#102 Zone Interface

None
closed
nobody
None
5
2019-05-18
2006-07-31
Anonymous
No

I think it could be very helpful to people implementing
DNS servers with this project if the Zone class were
split into an interface and an implementation (with all
of the other classes using the interface type of course).

(I've done this to my local copy of dnsjava in about 30
seconds using Eclipse without any problems.)

Discussion

  • Brian Wellington

    Logged In: YES
    user_id=63197

    This sounds like a good idea, but making Zone into an
    interface could break existing code (although I'm not sure
    how much existing code there is that uses Zones). I'd like
    to see the changes as a patch, but I don't know if it could
    be applied before a 2.1.0 release.

     
  • Bill Kuker

    Bill Kuker - 2006-09-26

    Logged In: YES
    user_id=1307910

    Right. I just made an interface named ZoneI withevery public
    function from Zone, then replaced all inatances of Zone in
    the DNSJava library with ZoneI.

    This makes it source compatable, but not binary compatable,
    with any existing code. It'd be cleaner to name the
    interface Zone and the current Zone class like BasicZone or
    whatever.

    For a much smaller change to the software to make what I am
    after possible I instead created a protected zero arg
    constructor in Zone and reimplemented every single function.
    This wastes a little memory on the instance variables in
    Zone that I never use, but otherwise works fine. This
    depends on the visibility of all the methods & members in
    Zone being either PUBLIC, PROTECTED or PRIVATE, NO package
    visability, as that would lead to things someone
    reimplementing Zone from scratch could not replace.

    Maybe that would be a better feature request.

     
  • Bill Kuker

    Bill Kuker - 2006-09-26

    Logged In: YES
    user_id=1307910

    Also, sorry I guess I submitted the original suggestion
    anonymously. It was me.

     
  • Bill Kuker

    Bill Kuker - 2006-09-28

    Logged In: YES
    user_id=1307910

    Also SetResponse would need a bit of a change, just the
    ability for a new Zone implementation to create and add
    records to it. Making some methods protected instead of
    package-only might be the smallest change to make this happen.

     
  • Ingo

    Ingo - 2019-05-18

    Ticket moved from /p/dnsjava/feature-requests/7/

     
  • Ingo

    Ingo - 2019-05-18
    • Status: open --> closed
     
MongoDB Logo MongoDB