TAXIIProject / django-taxii-services

Installable taxii_services
http://taxiiproject.github.io/
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

Reconsider Message Handler / Query Handler architecture #43

Open MarkDavidson opened 9 years ago

MarkDavidson commented 9 years ago

This issue comprises a couple of related items.

  1. I have a desire to have short-ish import names for the built-in handlers (e.g., DiscoveryRequestHandler) because these names are present in the UI. These were in taxii_services/__init__.py, but they were causing an issue where basically any time taxii_services was imported, the whole library would get imported. As a result, it might make sense to bring back the imports that were removed in https://github.com/TAXIIProject/django-taxii-services/commit/d412c5af39efb7b71268b2a6add288f5b8f37784, but bring them back into taxii_services.message_handlers (aka down a level).
  2. Message Handlers and Query Handlers are currently in separate areas of the library. I had initially done it that way to frame my own mental workspace. I did not want to think about the Message Handlers when working on the Query Handlers and vice versa. However, my mental workspace might not be the best code architecture (who knew, right?). So I think it makes sense to reconsider what the architecture is and see if there's something that makes more sense to people who aren't me.
gtback commented 9 years ago

I'm OK with the proposed solution to the first item (which is really trying to address #39).

Regarding the second item, I am mostly interested in removing unnecessary (and duplicative) information from module/package names. I've never really liked the term "handlers", since to me it doesn't mean much (like "stuff" or "things"). Here's one idea for reorganizing them:

taxii_services
    handlers
        messages
            __init__
            base (this could really all go into __init__)
            collectioninfo
            discovery
            inbox
            poll (could possibly split out poll_fulfillment, which is currently spelled wrong)
            subscription
        query
            __init__
            base (again, could be combined into __init__)
            stix111

Maybe the real issue is that I really hate underscores in package names :person_frowning: