The Mango Tree
Release 1.4
Mango is a collection of D packages with an orientation toward server-side programming. These packages may be used together or in isolation and, in many cases, can be just as applicable to client-side development. Mango is targeted for Win32 and linux platforms.
There are currently eight packages under the Mango Tree:
- mango.io: a high-performance buffered IO package. Primary functionality includes memory Buffers, external Conduits (files, sockets, etc), file-system manipulation, several flavors of Readers and Writers (formatted data), TextFormat (printf) and TextLayout support, class serialization, tokenization, and a whole lot more. Socket support is via the gracious provision of Christopher Miller's socket module. See FilePath, FileProxy, FileConduit, FileSystem, SocketConduit, ServerSocket, MulticastSocket, SocketListener, Token, Stdin, Stdout, Reader, Writer, IPickle and PickleRegistry.
- mango.http.client: An HTTP client for conversing with a remote HTTP server. Supports headers, query parameters, cookies, timeout etc. Tokenizer classes in mango.io are handy for parsing returned content. See HttpClient.
- mango.http.server: an HTTP server framework is provided for implementing a variety of high performance servers based on the HTTP protocol. This is not a fully-fledged v1.1 implementation. That is, it doesn't currently support 'fields' or 'keep alive'. However, it happily processes each request without allocating memory, making it unusually efficient. This is an example of how D array-slicing can seriously improve runtime efficiency. An open-source HTTPS library should be fairly easy to bolt in. Modules HttpServer and IProvider are the primary entry points: you implement an instance of the latter, and hand it to the former.
- mango.servlet: A servlet-style engine that sits upon mango.server. Includes most of the things that Java servlet programmers would expect, and attempts to improve in certain key areas such as the IO system. See Servlet and ServletProvider.
- mango.cache: Some simple caching mechanisms. Includes MRU caching via a queue, and level-two caching (to disk) via class-serialization. Now based upon a derivative of Doug Lea's concurrent hashmap. The mango.cluster package derives from mango.cache, so it's really easy to switch between a local cache implementation and a clustered version. See ICache, IMutableCache, PlainCache, QueuedCache and VirtualCache.
- mango.log: A port of the wildly popular Log4J package, for logging and tracing of runtime behaviour. See this page for an introduction to Log4J. Mango.log exposes an extensible and customizable framework, has been optimised heavily for minimal runtime overhead, does not impact the GC once initialised, and operates with either Mango.io or Phobos. Mango.log can generate remote log messages for use with Chainsaw, and has a browser-based 'Administrator' which allows remote, dynamic inspection and adjustment of the log settings within an executing program. See Logger, BasicConfigurator and PropertyConfigurator. There are a number of examples that show how to use these facilities (e.g Servlets.d)
- mango.cluster: A clustering package for servers and other network aware applications. Currently supports clustered caching and queuing, where the former is limited to a fixed MRU number of entries per node, and the latter is limited to an upper memory waterline. While the underlying QOS (quality of service) substrate is setup to be plugable, the QOS currently provided is stream/multicast based. Note that this package is not a substitute for a persistence layer; instead it is a tool for enabling horizontal scaling within a system that has been designed explicitly from the outset to scale. On the other hand, it can significantly enhance the throughput of any persistence layer by offloading a large percentage of read operations. See CacheInvalidatee, CacheInvalidator, NetworkCombo, NetworkAlert, NetworkCache and NetworkQueue.
- mango.icu: Set of wrappers around the ICU I18N project. See this page for the scoop on what is probably the most comprehensive and functional project in this particular arena. Mango.icu exposes the C API in a manner that takes advantage of D arrays and so on. See UCalendar, UChar, UConverter, UDateFormat, ULocale, UMessageFormat, UNumberFormat, UResourceBundle, UString, UText, UCollator, USet, UTransform, USearch, UNormalize, UDomainName, UBreakIterator, and UTimeZone. Numeric formatting is handled by a range of subclasses, including UDecimalFormat, UCurrencyFormat, UPercentFormat, UScientificFormat, and USpelloutFormat. There is set of adapter classes in UMango which can be used to bind the ICU converters to Mango.io, thereby enabling Reader and Writer with the full suite of unicode transcoders.
Package dependencies are as follows (from left to right):
mango.io => phobos (minimal)
mango.log => mango.io (without -version=Isolated)
mango.icu => mango.io (without -version=Isolated)
mango.cache => mango.io
mango.http.server => mango.io
mango.http.client => mango.io, mango.server
mango.cluster => mango.io, mango.cache, mango.log
mango.servlet => mango.io, mango.http.server, mango.cache, mango.log
Mango.icu and Mango.log are also made available as independent packages, outside of the regular Mango Tree. To enable this, specify the flag -version=Isolated when building those packages
You might take a look at the unittest.d source to get a general feel for functionality, and browse the various pdf files here along with the class-hierarchy or alphabetical-list linked at the top of this page. There's also a set of examples over here. Those will probably be sufficient to get an idea where the Mango Tree might come in handy within your projects.
Discussion forums are hosted here, and the general introduction starts here.
Generated on Fri Nov 11 18:44:18 2005 for Mango by
1.4.0