Something tells me I might get lynched for asking this. And sorry for the long winded description in advance.
I am using an API that violates the Liskov substitution principle : it throws its own Exception type that extends Exception, but puts the exception message from the base class in a new ErrorCode field
I find Java\'s exception hierarchy confusing. Throwable is divided into Error and Exception, and RuntimeException inherits from Exception.
Apologies in advance for a long-winded question. Feedback especially appreciated here . . . In my work, we do a lot of things with date ranges (date periods, if you will). We need to take all sorts o
Suppose I have an abstract class like: public abstract class Pet { private final String name; public Pet(String name) {
See the definition of System.Array class public abstract class Array : IList, ... Theoretically, I should be able to write this bit and be happy
The following does work because of the (Liskov) substitution principle, which says that if a reference is expected of an instance of a certain class then you may substitute a reference to an instance
The Adapter design pattern is used to convert the interface of a class (Target) into another interface (Adaptee) clients expect. Adapter lets incompatible classes work together that could not otherwis
I\'ve been trying to understand the Liskov Substitution Principle for a couple of days now, and while doing some code tests with the very typical Rectangle/Square example, I created the code below, an
The Liskov Substitution Principle (LSP) on Wikipedia Say I have a Alien class with an numFingers attribute*.Occasionally, I need to pull the sum of the numFingers from the database, grouped by othe