Pattern for validating rules having different signatures
I have a class in charge of responding to an input event and maybe triggering another event. To decide, it has several rules to check.
Pattern for validating rules having different signatures
I have a class in charge of responding to an input event and maybe triggering another event. To decide, it has several rules to check.
Pattern for validating rules having different signatures
I have a class in charge of responding to an input event and maybe triggering another event. To decide, it has several rules to check.
Should I validate a method call’s return value even if I know that the method can’t return bad input?
I’m wondering if I should defend against a method call’s return value by validating that they meet my expectations even if I know that the method I’m calling will meet such expectations.
Should I validate a method call’s return value even if I know that the method can’t return bad input?
I’m wondering if I should defend against a method call’s return value by validating that they meet my expectations even if I know that the method I’m calling will meet such expectations.
Should I validate a method call’s return value even if I know that the method can’t return bad input?
I’m wondering if I should defend against a method call’s return value by validating that they meet my expectations even if I know that the method I’m calling will meet such expectations.
How do I model this relationship so that it is valid by construction?
Imagine a device
class that represents a physical real world mobile device, with fields like Enabled
, Platform
, Model
IMEI
, etc. Then, an operation
class, which is something that needs to be done to a certain device, like DeviceEnablementOperation
or LockOperation
. This is a ‘one device to many operations’ relationship, and an operation cannot exist without being related to an existing device. Can I model this in such a way that the system will not allow certain types of operations to devices with certain platforms? For example, an Android device would not allow a DeviceEnablementOperation
attached to it, while a Windows Phone device would.
How do I model this relationship so that it is valid by construction?
Imagine a device
class that represents a physical real world mobile device, with fields like Enabled
, Platform
, Model
IMEI
, etc. Then, an operation
class, which is something that needs to be done to a certain device, like DeviceEnablementOperation
or LockOperation
. This is a ‘one device to many operations’ relationship, and an operation cannot exist without being related to an existing device. Can I model this in such a way that the system will not allow certain types of operations to devices with certain platforms? For example, an Android device would not allow a DeviceEnablementOperation
attached to it, while a Windows Phone device would.
What is the correct way to test performance of methods?
I made a few classes for processing and validating data in xlsx and csv.
Validation Rule or Business Rule
I am in a confusion where I cannot decide whether a rule is validation rule or Business rule. I have simple POJO with JSR 303 bean validation rules.