Safe language support for feature composition through feature-based dispatch
Language support for independent feature development and feature composition is a relatively young research topic, and the precise requirements of a feature composition operator are not yet fully understood. Suppose we are developing a large software system to sup-port a stock management business. The core functionality of such a system is simply adding items to the stock, remov-ing items and retrieving an inventory of the actual stock-or a subset thereof. The essence of the business is based on charging fees for the core services, starting with charging for stocking items. Such a business model requires features for customer (user) management, for tracking the cost of manip-ulating the stock and for authenticating and billing clients that use our services. Furthermore, to avoid planning prob-lems, such as one of our clients running out of stock, we support features that implement different planning and or-dering strategies. Additional features could be: monitoring the availability of certain items in the stock, sending a noti-fication when the availability reaches a certain level and so on. In the context of the example, the need for different kinds of feature composition arises: some features should be ac-tivated only when certain clients use our application, some features must always be composed (eg. the authentication and billing features), other features may be composed dy-namically (to change the ordering strategy, for example), some conflict (you may only select one ordering strategy) and again others are optional (the notification feature can only fully function when the monitoring feature is available, but the composition may still be legal when the notification feature is composed without the monitoring feature). The above examples indicate some of the requirements of a composition operator. In many cases, and especially in the development of large software systems, the use cases for feature-composition can be summarised as follows: there are a number of core abstractions (objects such as a stock item, a client, the warehouse,...), which may be enriched dynam-