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
There are various locations within the code where a == null check is needed. For instance, when querying the bed width or originBottomLeft properties, default values need to be used if no device has been selected most of the time.
The Null Object pattern fills such attributes with sensible "default" values. For instance, a null LaserDevice might have a bed width of 600mm, a bed height of 300mm and a top left origin. This would replace the many duplicate default values scattered across the whole code base.
There might be other use cases as well. I'll first add it to LaserDevice in preparation for my work on #713.
The text was updated successfully, but these errors were encountered:
I've worked with the codebase for a few days now and given the number of occurrences and the less-than-ideal interface design (many interfaces are quite bloated), I've come to the conclusion that this pattern won't solve any actual problems, at least for now. Some refactoring is required beforehand, namely reorganizing LaserDevice and LaserCutter and related classes. I'll continue with the existing codebase for now, #713 is a bigger priority.
There are various locations within the code where a
== null
check is needed. For instance, when querying the bed width ororiginBottomLeft
properties, default values need to be used if no device has been selected most of the time.The Null Object pattern fills such attributes with sensible "default" values. For instance, a null
LaserDevice
might have a bed width of 600mm, a bed height of 300mm and a top left origin. This would replace the many duplicate default values scattered across the whole code base.There might be other use cases as well. I'll first add it to
LaserDevice
in preparation for my work on #713.The text was updated successfully, but these errors were encountered: