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
Problem:
The Booking class has several issues related to encapsulation and method structure:
Lack of Public Properties:
The class does not expose its internal fields through properties, making it difficult to retrieve booking details.
Non-Static Utility Method (IsBetween)
The IsBetween() method does not depend on instance state and should be marked as static.
Missing Validation for Constructor Parameters
The constructor does not check for null values for key fields, which could lead to runtime exceptions.
Fixes:
Add public properties for id, dateRange, customer, bookingType, discount, and tax.
Make IsBetween() static since it does not use instance-specific data.
Add null checks in the constructor to enforce data integrity.
The text was updated successfully, but these errors were encountered:
Problem:
The Booking class has several issues related to encapsulation and method structure:
Lack of Public Properties:
The class does not expose its internal fields through properties, making it difficult to retrieve booking details.
Non-Static Utility Method (IsBetween)
The IsBetween() method does not depend on instance state and should be marked as static.
Missing Validation for Constructor Parameters
The constructor does not check for null values for key fields, which could lead to runtime exceptions.
Fixes:
Add public properties for id, dateRange, customer, bookingType, discount, and tax.
Make IsBetween() static since it does not use instance-specific data.
Add null checks in the constructor to enforce data integrity.
The text was updated successfully, but these errors were encountered: