The Mikado Method by Ola Ellnestam Daniel Brolund

The Mikado Method by Ola Ellnestam Daniel Brolund

Author:Ola Ellnestam Daniel Brolund
Language: eng
Format: epub
Publisher: Manning Publications


Problem

Another common scenario when restructuring code is that you find a class that implements the contract of an abstraction or a base class, but when you make assumptions based on this, you get runtime or compiler errors. This is likely because the contract of the abstraction is broken in some way.

There are several ways to break a contract, and a common example is the Square-Rectangle problem. For example, here’s a Rectangle class:

public class Rectangle { public Rectangle(int height, int width) { . . . } public void setHeight(int height) { . . . } public int getHeight() { . . . } public void setWidth(int width) { . . . } public int getWidth() { . . . } }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.