Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
The {{java.util.Calendar}} class provides a {{compareTo()}} method and an {{after()}} method. The {{after()}} method is documented in the _Java API Reference_ \[[API 2006|AA. Bibliography#APIReferences#API 06]\] as follows:

The after() method returns whether this Calendar represents a time after the time represented by the specified Object. This method is equivalent to
compareTo(when) > 0
if and only if when is a Calendar instance. Otherwise, the method returns false.

...

Wiki Markup
This compliant solution uses a design pattern called composition and forwarding (sometimes also called delegation) \[[Lieberman 1986|AA. Bibliography#LiebermanReferences#Lieberman 86]\], \[[Gamma 1995|AA. Bibliography#GammaReferences#Gamma 95], p. 20\]. The compliant solution introduces a new _forwarder_ class that contains a private member field of the {{Calendar}} type; this is _composition_ rather than inheritance. In this example, the field refers to {{CalendarImplementation}}, a concrete instantiable implementation of the {{abstract}} {{Calendar}} class. The compliant solution also introduces a wrapper class called {{CompositeCalendar}} that provides the same overridden methods found in the {{CalendarSubclass}} from the preceding noncompliant code example.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3b73acd3557f2158-c0c1c939-4c0845ce-abbea2ce-8577df38d2a589c217effdde"><ac:plain-text-body><![CDATA[

[[API 2006

AA. Bibliography#API References#API 06]]

[Class Calendar

http://download.oracle.com/javase/6/docs/api/java/util/Calendar.html]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0813c723e8ddf0fa-14ef52d8-42f04824-8676aaae-8514f8bb6df4caf6005d1894"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. Bibliography#Bloch References#Bloch 08]]

Item 16. Favor composition over inheritance

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="16545260807431d5-682029a7-44c346e0-a8bebd20-63be1497d7d5f2daa0c53fbc"><ac:plain-text-body><![CDATA[

[[Gamma 1995

AA. Bibliography#Gamma References#Gamma 95]]

Design Patterns, Elements of Reusable Object-Oriented Software

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="50276b19c12644b2-0dc561bd-485f4e7e-a512b6d0-9cb7005d56de591574263f53"><ac:plain-text-body><![CDATA[

[[Lieberman 1986

AA. Bibliography#Lieberman References#Lieberman 86]]

Using prototypical objects to implement shared behavior in object-oriented systems

]]></ac:plain-text-body></ac:structured-macro>

...