You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now you need to know what should be passed to LVMLogicalVolumeDevice to get your desire LVM device. It would be great to have factory pattern in addition to this big __init__() method.
For example:
Now: dev = LVMLogicalVolumeDevice("name", parents=[parent], seg_type="thin")
After: dev = LVMLogicalVolumeDevice.create_thin_snapshot("name", parents=[parent])
It is immediately clear what will be created and it is much easier to create this.
The text was updated successfully, but these errors were encountered:
For example:
Now:
dev = LVMLogicalVolumeDevice("name", parents=[parent], seg_type="thin")
After:
dev = LVMLogicalVolumeDevice.create_thin_snapshot("name", parents=[parent])
I don't think those should be class methods. I know a "factory" is a design pattern, but this is not Java, we can afford the luxury of having functions.
No problem with that.
I just want to see this without much digging in the code. It is creating LVMLogincalVolumeDevice instance so it give sense to me to call it from this class instead of standalone function. I guess that I would probably miss that standalone functions.
Right now you need to know what should be passed to
LVMLogicalVolumeDevice
to get your desire LVM device. It would be great to havefactory
pattern in addition to this big__init__()
method.For example:
Now:
dev = LVMLogicalVolumeDevice("name", parents=[parent], seg_type="thin")
After:
dev = LVMLogicalVolumeDevice.create_thin_snapshot("name", parents=[parent])
It is immediately clear what will be created and it is much easier to create this.
The text was updated successfully, but these errors were encountered: