OnlyOneConstructor


Youngrok Pak at 13 years ago.

From XPMailingList

  1. There is only one way to create an object. One Constructor.
  2. If you need various ways to create an object, those are "merely" convenience methods that delegate to the One Constructor. Since this is confusing, don't implement them as constructors, but rather as "named constructors" (class-level creation methods) that figure out how to call the One Constructor properly.

-- J. B. (Joe) Rainsberger


Comments




Wiki at WikiNamu