Ryan's District
November 22, 2008, 02:57:57 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Ryan's District Lottery: Claim your ticket or check
Jackpot details  
 
   Home   Help Search Chat Calendar Chess Shop Login Register  
Digg This!
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: c++ Tips - The open/closed principle  (Read 3036 times)
0 Members and 1 Guest are viewing this topic.
ben2ong2
Quality Poster
Paid
Hero Member
*****

Reputation: 17
Offline Offline

Gender: Male
Posts: 2374
9976.80 RD$

View Inventory
Send Money to ben2ong2

View Profile Awards
« on: October 07, 2006, 03:05:57 AM »

PROBLEM: djones@megatest.com (Dave Jones)

"Open/closed principle"  ... what is it, and who first buzzed the words?


RESPONSE: justin@logcam.co.uk (Justin Forder), 18 May 93

Bertrand Meyer, in "Object-oriented Software Construction", page 23:

"The Open-Closed Principle

A satisfactory modular decomposition technique must satisfy one more
requirement: it should yield modules that are _both_ open and closed.

- A module will be said to be open if it is still available for extension.
  For example, it should be possible to add fields to the data structures
  it contains, or new elements to the set of functions it performs.

- A module will be said to be closed if it is available for use by other
  modules. This assumes that the module has been given a well-defined,
  stable description (the interface in the sense of information hiding).
  In the case of a programming language module, a closed module is one
  that may be compiled and stored in a library, for others to use.
  In the case of a design or specification module, closing a module
  simply means having it approved by management, adding it to the project's
  official repository of accepted software items (often called the project
  _baseline_), and publishing its interface for the benefit of other
  module designers."

Meyer goes on to give an example, and to explain how the tension between
delivering stable items to their users, on the one hand, and maintaining
extensibility, on the other, gives real problems in classical development
approaches. With inheritance and polymorphism, a class can be closed (in
the sense that it is complete and delivers what its interface description
promises) and open (because you can specialise it). When new subclasses are
introduced, neither the original class nor its clients need to be edited or
recompiled.


Logged

You are not allowed to view links.
Register or Login
Free Paid Survey & Home Business Resources.

You are not allowed to view links.
Register or Login
Free Article Directory | Quality Content
Ryan's District
« on: October 07, 2006, 03:05:57 AM »

 Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Archive - WAP2 - WAP - imode
Sponsors: RAYAN.tv
-

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 1.563 seconds with 30 queries.

Google visited last this page November 20, 2008, 05:11:39 AM