philosophy.html   [plain text]


<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><title>Twisted Documentation: Philosophy</title><link href="../howto/stylesheet.css" type="text/css" rel="stylesheet" /></head><body bgcolor="white"><h1 class="title">Philosophy</h1><div class="toc"><ol><li><a href="#auto0">Abstraction Levels</a></li><li><a href="#auto1">Learning Curves</a></li></ol></div><div class="content"><span></span><h2>Abstraction Levels<a name="auto0"></a></h2><p>When implementing interfaces to the operating system or
the network, provide two interfaces:</p><ul><li>One that doesn't hide platform specific or library specific 
functionality.
For example, you can use file descriptors on Unix, and Win32 events on
Windows.
</li><li>One that provides a high level interface hiding platform specific 
details.
E.g. process running uses same API on Unix and Windows, although
the implementation is very different.
</li></ul><p>Restated in a more general way:</p><ul><li>Provide all low level functionality for your specific domain,
without limiting the policies and decisions the user can make.</li><li>Provide a high level abstraction on top of the low level
implementation (or implementations) which implements the
common use cases and functionality that is used in most cases.</li></ul><h2>Learning Curves<a name="auto1"></a></h2><p>Require the minimal amount of work and learning on part of the
user to get started. If this means they have less functionality,
that's OK, when they need it they can learn a bit more. This
will also lead to a cleaner, easier to test design.</p><p>For example - mktap together with twistd is a great way to
deploy applications. But to get started you don't need to know
or care about either. Later on you can start using twistd,
and if you choose mktap as well. Using them is optional.</p></div><p><a href="../howto/index.html">Index</a></p><span class="version">Version: 1.3.0</span></body></html>