defines the pre, post conditions of system
Code to interface as opposed to implementation.
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
The basic idea is that you want to define:
a) what is required before you call to a system (method/class) - these are the pre conditions
b) what will be changed by this call - these are the post conditions
rather than relying on the details of the current implementation.
The postconditions would be that it returns (b) the date of the day of the month
If you are programming to the interface - to the definition of what this method should do, then you know that this is a bug and that "computeLastDayOfMonth" should return the correct date on a leap year.
If there is no "contract", no "pre and post conditions" then in theory you could say this method should ignore leap years and always return the same last day of the month - since it's not defined anywhere. This is coding to the implementation (since that's what the method actually does).
Assuming it is current application or system and we are about to do some enhancement to it or defect fixing to a production system right ?
you mean end date of the month right?
Any real world examples, links, resources elaborating more on this differentiation between 'programing to the interface'(which i am thinking same as design by contract) vs design/programming to the implementation'
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.