mirror of
https://github.com/boostorg/website.git
synced 2026-01-29 20:12:14 +00:00
Merged revisions 52740,52742,52963,53164,53320-53321,53323-53324,53326,53507,53509,53710 via svnmerge from https://svn.boost.org/svn/boost/website/public_html/beta ........ r52740 | danieljames | 2009-05-02 18:25:29 +0100 (Sat, 02 May 2009) | 1 line Merge from live, up to 52379. ........ r52742 | danieljames | 2009-05-02 18:33:49 +0100 (Sat, 02 May 2009) | 1 line Release 1.39 ........ r52963 | joaquin | 2009-05-13 11:42:54 +0100 (Wed, 13 May 2009) | 1 line merged [52962] from live website ........ r53164 | danieljames | 2009-05-21 22:33:28 +0100 (Thu, 21 May 2009) | 1 line Make the check for '<body' case insensitive when processing the doucmentation. ........ r53320 | danieljames | 2009-05-27 20:23:01 +0100 (Wed, 27 May 2009) | 1 line Add link to 'Die Boost C++ Bibliotheken' to bibliography. ........ r53321 | danieljames | 2009-05-27 20:23:10 +0100 (Wed, 27 May 2009) | 1 line Correct mime type for csshover.htc ........ r53323 | danieljames | 2009-05-27 20:50:45 +0100 (Wed, 27 May 2009) | 2 lines Upgrade to css hover 3 and only use it for IE 7 as it causes IE 6 to crash and isn't needed on IE 8. ........ r53324 | danieljames | 2009-05-27 20:51:26 +0100 (Wed, 27 May 2009) | 1 line Try to prevent wide content on sidebar from messing up layout on IE. ........ r53326 | danieljames | 2009-05-27 21:46:51 +0100 (Wed, 27 May 2009) | 1 line Try to deal with content overflowing in the directory element in IE6. ........ r53507 | danieljames | 2009-05-31 18:53:02 +0100 (Sun, 31 May 2009) | 1 line Missing redirect for writingdoc. ........ r53509 | danieljames | 2009-05-31 19:05:53 +0100 (Sun, 31 May 2009) | 1 line Link to the wiki on the front page. ........ r53710 | danieljames | 2009-06-07 11:32:33 +0100 (Sun, 07 Jun 2009) | 1 line Add a hook for pre-processing the extracted file from the zipfile. ........ [SVN r53714]
123 lines
5.3 KiB
HTML
123 lines
5.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
<head>
|
|
<title>Boost Library Reuse</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
|
|
<link rel="icon" href="/favicon.ico" type="image/ico" />
|
|
<link rel="stylesheet" type="text/css" href=
|
|
"/style/section-development.css" />
|
|
<!--[if IE 7]> <style type="text/css"> body { behavior: url(/style/csshover3.htc); } </style> <![endif]-->
|
|
</head><!--
|
|
Note: Editing website content is documented at:
|
|
http://www.boost.org/development/website_updating.html
|
|
-->
|
|
|
|
<body>
|
|
<div id="heading">
|
|
<!--#include virtual="/common/heading.html" -->
|
|
</div>
|
|
|
|
<div id="body">
|
|
<div id="body-inner">
|
|
<div id="content">
|
|
<div class="section" id="intro">
|
|
<div class="section-0">
|
|
<div class="section-title">
|
|
<h1>Boost Library reuse: cost versus benefit trade-offs</h1>
|
|
</div>
|
|
|
|
<div class="section-body">
|
|
<p>A Boost library <strong>should not</strong> use libraries
|
|
other than Boost or the C++ Standard Library.</p>
|
|
|
|
<p>A Boost library <strong>should</strong> use other Boost
|
|
Libraries or the C++ Standard Library, but only when the
|
|
benefits outweigh the costs.</p>
|
|
|
|
<p>The benefits of using components from other libraries may
|
|
include clearer, more understandable code, reduced development
|
|
and maintenance costs, and the assurance which comes from
|
|
reusing well-known and trusted building blocks.</p>
|
|
|
|
<p>The costs may include undesirable coupling between
|
|
components, and added compilation and runtime costs. If the
|
|
interface to the additional component is complex, using it may
|
|
make code less readable, and thus actually increase development
|
|
and maintenance costs.</p>
|
|
|
|
<p>Negative effects of coupling become obvious when one library
|
|
uses a second library which uses a third, and so on. The worst
|
|
form of coupling requires the user understand each of the
|
|
coupled libraries. Coupling may also reduce the portability of
|
|
a library - even in case when all used libraries are
|
|
self-sufficient (see example of questionable usage of
|
|
<iostream> library below).</p>
|
|
|
|
<p><strong>Example where another boost component should
|
|
certainly be used:</strong> boost::noncopyable (in <a href=
|
|
"/doc/libs/release/boost/utility.hpp">boost/utility.hpp</a>)
|
|
has considerable benefits; it simplifies code, improves
|
|
readability, and signals intent. Costs are low as coupling is
|
|
limited; noncopyable itself uses no other classes and its
|
|
header includes only the lightweight headers
|
|
<boost/config.hpp> and <cstddef>. There are no
|
|
runtime costs at all. With costs so low and benefits so high,
|
|
other boost libraries should use boost::noncopyable when the
|
|
need arises except in exceptional circumstances.</p>
|
|
|
|
<p><strong>Example where a standard library component might
|
|
possibly be used:</strong> Providing diagnostic output as a
|
|
debugging aid can be a nice feature for a library. Yet using
|
|
Standard Library <iostream> can involves a lot of
|
|
additional cost, particularly if <iostream> is unlikely
|
|
to be use elsewhere in the application. In certain GUI or
|
|
embedded applications, coupling to <iostream> would be a
|
|
disqualification. Consider redesign of the boost library in
|
|
question so that the user supplies the diagnostic output
|
|
mechanism.</p>
|
|
|
|
<p><strong>Example where another boost component should not be
|
|
used:</strong> The boost dir_it library has considerable
|
|
coupling and runtime costs, not to mention portability issues
|
|
for unsupported operating systems. While completely appropriate
|
|
when directory iteration is required, it would not be
|
|
reasonable for another boost library to use dir_it just to
|
|
check that a file is available before opening. C++ Standard
|
|
Library file open functionality does this at lower cost. Don't
|
|
use dir_it just for the sake of using a boost library.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="sidebar">
|
|
<!--#include virtual="/common/sidebar-common.html" -->
|
|
<!--#include virtual="/common/sidebar-development.html" -->
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="footer">
|
|
<div id="footer-left">
|
|
<div id="revised">
|
|
<p>Revised $Date: 2007-10-22 22:55:52 +0100 (Mon, 22 Oct 2007) $</p>
|
|
</div>
|
|
|
|
<div id="copyright">
|
|
<p>Copyright Beman Dawes 2000.</p>
|
|
</div><!--#include virtual="/common/footer-license.html" -->
|
|
</div>
|
|
|
|
<div id="footer-right">
|
|
<!--#include virtual="/common/footer-banners.html" -->
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
</div>
|
|
</body>
|
|
</html>
|