Skip to content

Hide implementation details #169

Description

@sajith

Treating TESolver and TopologyManager classes as private implementation details should make this library easier to use, and thus reduce the chances of confusion. We could:

  • Make TEManager provide all of the surface API to PCE, by moving TESolver and TopologyManager classes to a private module.
  • "Gate" the necessary methods via TEManager.

As a more concrete example, consider this code sample from the README:

from sdx_pce.load_balancing.te_solver import TESolver
from sdx_pce.topology.temanager import TEManager

temanager = TEManager(initial_topology)
for topology in topologies:
    temanager.add_topology(topology)
    
graph = temanager.generate_graph_te()
traffic_matrix = temanager.generate_traffic_matrix(connection_request)

solution = TESolver(graph, traffic_matrix).solve()

breakdown = temanager.generate_connection_breakdown(solution)
for domain, link in breakdown.items():
    # publish(domain, link)

This would become:

from sdx_pce.topology.temanager import TEManager

temanager = TEManager(initial_topology)
for topology in topologies:
    temanager.add_topology(topology)
    
# generate graph, traffic matrix, and call TESolver.solve()
solution = temanager.solve(connection_request)

breakdown = temanager.generate_connection_breakdown(solution)
for domain, link in breakdown.items():
    # publish(domain, link)

Or maybe even:

from sdx_pce.topology.temanager import TEManager

temanager = TEManager(initial_topology)
for topology in topologies:
    temanager.add_topology(topology)

# generate graph, traffic matrix, call TESolver.solve(), and 
# then return a breakdown usable across domain.
breakdown = temanager.solve(connection_request)

for domain, link in breakdown.items():
    # publish(domain, link)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions