Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename DeviceModelStorage to DeviceModelInterface #768

Merged

Conversation

maaikez
Copy link
Contributor

@maaikez maaikez commented Sep 3, 2024

Describe your changes

Rename 'DeviceModelStorage' to 'DeviceModelInterface'

Issue ticket number and link

#766

Checklist before requesting a review

…ues. Currently only the 'OCPP' source is accepted.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Copy link
Contributor

@Pietfried Pietfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

/// functionality to support the use cases defined in the functional block Provisioning
class DeviceModel {

private:
DeviceModelMap device_model;
std::unique_ptr<DeviceModelStorage> storage;
std::unique_ptr<DeviceModelInterface> interface;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would rather call this device_model_interface or just device_model and rename the
DeviceModelMap device_model to device_model_map

@Pietfried Pietfried linked an issue Sep 20, 2024 that may be closed by this pull request
@marcemmers
Copy link
Contributor

I am actually implementing some tests that make use of the device model at the moment. That made me think if DeviceModelInterface is the right name for this? Since we might want to mock the DeviceModel itself in the future as well and then that should also get the name DeviceModelInterface right?

@maaikez
Copy link
Contributor Author

maaikez commented Nov 11, 2024

DeviceModelMock?

It is an interface isn't it? So what is your proposal then?

@marcemmers
Copy link
Contributor

Well the pattern we are using is ChargePoint implements a ChargePointInterface, following that the DeviceModel should implement the DeviceModelInterface if we are ever going to make unit tests for the device model. But now it actually is using the interface instead. So maybe DeviceModelStorageInterface? I am not sure what the reason was to go away from "Storage"?

@maaikez
Copy link
Contributor Author

maaikez commented Nov 11, 2024

Because it does not have to be a storage, if the implementer does not want to make it a storage (which is strange, I admit, but it might be runtime something).

@maaikez maaikez force-pushed the feature/766-rename-devicemodelstorage-to-devicemodelinterface branch from 325713a to 1c8ef1d Compare November 11, 2024 14:29
@@ -6,6 +6,7 @@
"properties": {
"AlignedDataCtrlrEnabled": {
"variable_name": "Enabled",
"source": "OCPP",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we only have that im some of the files? To have an example?

Copy link
Contributor Author

@maaikez maaikez Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure anymore (it's a long time ago already), but I think so indeed.
I also don't know exactly which values should be for ocpp and which internal, from some I know but for the others we have to walk through them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, all should be OCPP

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Id suggest to remove the "source" here. It will be useful later when we add externally managed variables.

Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
@maaikez maaikez merged commit b00d278 into main Nov 14, 2024
7 of 8 checks passed
@maaikez maaikez deleted the feature/766-rename-devicemodelstorage-to-devicemodelinterface branch November 14, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename 'DeviceModelStorage' to 'DeviceModelInterface'
4 participants