Issue 39: Should NewCookie subclass Cookie

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 17 Jun 2008 14:43:38 -0400

"While they share a number of attributes, Cookie and NewCookie serve
different purposes. It might be cleaner if NewCookie contained a
Cookie rather than inheriting from it."

 From Stephan:

"Issue 39: if NewCookie should not subclass Cookie for design reasons,
then NewCookie could contain the same 5 attributes and it's getter. I
see no advantage that NewCookie has a Cookie as attribute. Another
possibility is a common subclass with the attributes of Cookie, or a
common interface. The first reduces the lines of code, and both allows
to handle a NewCookie and a Cookie together, if someone needs it. For
equals(.) a NewCookie must never be equal to a Cookie, also if all
values are the same, because noth classes have a little bit different
semantics. Perhaps we could add an equal method If there is a common
abstract class, their could be a method AbstractCookie.equals(Cookie,
boolean), which boolean parameter allows to indicate, if a Cookie
could be equal to a NewCookie or not."

I'm tempted to close this one with no action (i.e. leave it as
NewCookie extends Cookie) - anyone have a strong opinion to the
contrary ?


Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.