Skip to content

Separate Attribute handling from Contrib Adapter #834

@Renrut5

Description

@Renrut5

Separate attribute handling when loading Nautobot objects from NautobotAdapter to separate interface classes.

The goal is to refactor code to make it more SOLID compliant and break the code down into smaller chunks of code.

Currently, the NautobotAdapter class handles most to all interactions to pull information from the database when loading models in the SSoT DiffSync Store. This means the code is tightly coupled with itself and is not compliant with the Interface Segregation Principle nor the Single Responsibility Principle and makes the code quite complex and difficult to understand and/or follow.

Additionally, the current structure determines how to load each attribute from the database on every single model load. This can have performance impacts when loading many objects from Nautobot. By separating the attribute logic into separate classes and using those to load data, we only have to determine how to load once per attribute per model instead of for every model loaded.

Moving this code to their own classes will make maintaining the code easier while also making it more extendable.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions