The Mango Tree
Beta 9.5
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, Stdio, 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.
- 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 clone of the wildly popular Log4J package, for logging and tracing of runtime behaviour. See this page for an introduction to Log4J. Mango.log has a dependency upon mango.io for file access (PropertyConfigurator, FileAppender) and for one of the console appenders (StdioAppender). Other than that it is completely standalone, and it would be simple to replace/augment those appenders with alternatives. Mango.log can generate remote log messages, and has an HTML Admin Console which dynamically adjusts the log settings of an executing program. See Logger, BasicConfigurator and PropertyConfigurator.
- 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. This is an ongoing effort, so check back frequently! See UCalendar, UChar, UConverter, UDateFormat, ULocale, UMessageFormat, UNumberFormat, UResourceBundle, UString, UText, and UTimeZone. Numeric formatting is handled by a range of subclasses, including UDecimalFormat, UCurrencyFormat, UPercentFormat, UScientificFormat, and USpelloutFormat.
Package dependencies are as follows (from left to right):
mango.io => phobos (minimal)
mango.log => mango.io (with -version=Mango)
mango.icu => mango.io (with -version=Mango)
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
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 Sun Nov 7 19:06:49 2004 for Mango by
1.3.6