Skip to content

Refactoring Packages #583

Closed
Closed

Description

@boldtrn

Hi,

I'd like to refactor the package structure. Especially: com.graphhopper.routing.util. It would make sense to create at least two new subpackages: encoder and weighting. Actually these two packages could be moved to com.graphhopper.routing.

In the package com.graphhopper.routing a subpackage for the algorithms could make sense.

Activity

  1. karussell commented on Nov 30, 2015

    @karussell
    Member

    Sounds like a good idea. routing.util is indeed a bit too crowded! I would not split yet the encoder and weighting stuff as the meaning of them will slightly change with the flexibility work: an encoder will relate more to the storage (profile-independent) and weightings are then the real vehicle 'profiles'. But we should move both out of the routing.util somehow - but what name :) ? Or maybe moving encoders to storage(.encoding) and weighting to routing.weighting later maybe rename to routing.profiles?

    In the package com.graphhopper.routing a subpackage for the algorithms could make sense.

    My approach is rather simplistic: if it is crowded: split it. If not, like I think it is the case for the routing package, then avoid too many sub packages as naming packages is very important and we don't find good names if only a few classes are in the package. Although probably in this case routing.algorithm would be fine, plus routing.algorithm.ch

  2. boldtrn commented on Nov 30, 2015

    @boldtrn
    MemberAuthor

    Or maybe moving encoders to storage(.encoding) and weighting to routing.weighting later maybe rename to routing.profiles?

    Yes you are right. Encodings are actually storage related.
    If you want, we can add this to #579 or do this in a separate PR after we reduced the number of pending PRs (probably the better approach).

  3. karussell commented on Nov 30, 2015

    @karussell
    Member

    If you want, we can add this to #579 or do this in a separate PR after we reduced the number of pending PRs (probably the better approach).

    I would avoid mixing issues and smaller 'single-purpose' PRs are better IMO :)

    But it is no problem to have multiple PRs - except maybe the potential higher refactoring costs can be a problem.

  4. karussell commented on Sep 12, 2016

    @karussell
    Member

    Have now moved subnetwork and weighting stuff into their own package. Encoder remains there (at least for now), as this is work in progress which 'meaning' this has.

  5. karussell commented on May 6, 2020

    @karussell
    Member

    Will close here for now. See #2016.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions