Skip to content

Modularize main application code #99

@tuxalp

Description

@tuxalp

Modules and packages are common python concepts to organize application code.

This "issue" suggests to make use of these concepts to more cleanly separate "responsabilities" of the application, like:

  • ojpfare api
  • nova client
  • ojp1 client
  • ojp2 client
  • tests

Currently only these modules exist:

  • api
  • nova (generated code added to git)
  • ojp (generated code added to git)
  • ojp2 (generated code added to git)

Some other directories exist that are not python code:

  • logs
  • service
  • xslt

Servers and other packages reside in the plain project root, not in a module.

See also here for a description of directories:
https://github.com/openTdataCH/ojp-nova/blob/master/docs/file_structure.md

Proposal for new modules tree:

Module  Description
app Main application module with servers
app.api Hosts API , request/response handling including error handler
app.ojpfare1 Business logic implementing ojpfare v1
app.ojpfare1.ojp Business logic implementing trip request of ojpfare v1
  • map_ojp_to_ojp (?)
app.ojpfare1.ojp.xsdata xsdata generated py-files for ojp1
app.ojpfare1.fare Business logic implementing fare request of ojpfare v1
  • map_nova_to_ojp
  • map_ojp_to_nova
app.ojpfare2 Business logic implementing ojpfare v2
app.ojpfare2.ojp Business logic implementing trip request of ojpfare v2
  • map_ojp_to_ojp (?)
app.ojpfare2.ojp.xsdata xsdata generated py-files for ojp2
app.ojpfare2.fare Business logic implementing fare request of ojpfare v2
  • map_nova_to_ojp2
  • map_ojp2_to_nova
app.nova Client for NOVA Preisabfrage
app.nova.xsdata xsdata generated py-files for NOVA
test Packages used for testing only. Test packages may also go to according modules they test, e.g.: test_client.py to app.ojpfare1.ojp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions