Friday, March 18, 2005

Representing Policies as Aspects

The theories about aspects and aspect-oriented modeling are still developing. An aspect can be described by joint points and corresponding advice in terms of Aspect-Oriented Programming (AOP), which is an approach addresses the code tangling and code scattering issues. A joint point is the place where the concern will crosscut the application. An advice is the action that will be executed at the joint points. Similarly, a joint point of an autonomic policy is the target component or process whose behavior is modified to achieve the goal. The advice is the configuration parameters for managed resources. E.g. for the policy that
for the customers whose orders sum up to more than $3,000 in a day, apply 5% discount for the amount over $3,000.

the joint point is the pricing process of an item ordered by a customer, and the advice is to apply 5% discount to the amount over $3,000 if the sum of the customer's orders in that day exceed $3,000.

We could model policies as aspects. However, there are still many differences between policies and the aspects that we can implement using current AOP languages and tools. Policies are hierarchically organized. The subject of a high-level policy may have no idea about the details how its goal will be realized by low-level policies. The representations of policies may vary for the heterogeneous managed resources. The autonomic managers transform the policies to the versions that their managed resources can understand, and distribute them to the targets. Policy transformation and distribution will occur on each hierarchy of the system. The autonomic managers at higher hierarchies do not need to know all the details about how to deploy the policies. The complexity of these autonomic managers is reduced in this way.

The joint points and advice of a policy are modified in the process of transformation and distribution. E.g. for a policy to increase the service capability for all the web servers, the joint points are all the web servers in the resource pool, and the advice is to increase the service capability. When the policy is distributed to an Apache HTTP server, the joint point turns to the Multi-Processing Module, and the advice will be to increase the value of MaxClients, MinSpareThreads, and MaxSpareThreads with the constraint that MaxClients > ThreadsPerChild * ServerLimit.

The parameters in a policy are initialized in transformation and distribution. Suppose an enterprise has branches in charge of the business of different areas. Now a new policy as follows needs to be executed by all the branches.

For all customers whose orders sum up to more than certain amount in a day, apply certain discount for the amount over the amount.

The policy will be transformed to different versions at branches. For example, the amount and the discount are $3,000 USD and 5% for American customers, and $4,000 CAD and 4% for Canadian customers.

Policies transformation and distribution need a policy specification language. There are a number of running projects related to policy specification languages. XML-based specifications are widely endorsed. However, an industrial standard is in demand.

It will be easy to distribute policies represented in XML among autonomic elements using Web services. The policy will take effect once it is distributed and deployed at load time or runtime. AspectJ is a seamless aspect-oriented extension to the Java programming language. AspectJ defines the syntax for aspects and supplies a weaver to compose the system from classes and aspects. The future AspectJ will support XML representation of aspects and deployment at load time. The policy example in Section 3 may be implemented by the following code snippet in AspectJ.

public aspect TestDiscount {
pointcut checkOut() : call(public double getPrice(..));
after() : discount() {
applyDiscount(AMOUNT, PERCENT);

The joint point is a call to getPrice(..) method that retrieve the price of an item that the customer orders. The advice is to call applyDiscount(int amount, int percent) to apply the discount specified by certain AMOUNT and PERCENT.

Policy-based Systems Management

Policies are "high-level overall plans embracing the general goals and acceptable procedures" [1]. Policies are common methods of organizations and systems management. Policies reside at the top of the autonomic computing architecture [2]. Autonomic policies specify management requirements and criteria, the mechanism to distribute the policies among autonomic managers, and the configuration parameters for managed resources [3]. Currently, policy-based approaches are widely used in enterprise network management relevant to QoS and security. A team in IBM is developing a policy toolkit (PTK) that comprises modules that parse, edit, validate, transport, transform, and auto-update policies [4]. The policy-based IT management demo in IBM Emerging Technologies Toolkit (ETTK) shows how to manage database is using a policy-based approach in an autonomic computing environment. The policy management for autonomic computing package is released as well.

In a hierarchical autonomic system, the autonomic managers share the goals of high-level policies, while each autonomic manager has a private version of policies according to local environment and task. The same policy will have various representations for diverse autonomic managers and at different hierarchies of the systems. Policies are persistent during short periods. However, policies are also dynamic due to changing business and IT environments during long periods. The dynamic characteristics of policies will be more and more distinguishing with the trend of on-demand business, and request rapid deployment of policies on the fly.

Policies may be recorded in natural languages, specification languages, or general markup languages like XML. In object-oriented era, it is straightforward to represent policies as objects. Policies are represented as objects in some policy tools and policy specification languages like Ponder [5]. Policy objects can have attributes like modality, policy subject, policy target, policy goal, and policy constraints, operations like create, destroy, update, and query [6]. The interactions between policies include policy hierarchizing and policy prioritizing. The policy is a kind of 'cross-cutting' concern, which means a high-level policy will affect the behaviors of several sub-systems; many elements in a system may depend on the same policy to guide their actions; and a low-level policy may play roles in a number of atomic modules comprising an element. The crosscutting of policies results in tangled codes. It is hard to manage the policies that are scattered around modules. We suggest an aspectual view of policies for such issues.

[1] Merriam-Webster Online Dictionary, va=policy visited on Jan. 28, 05.

[2] S.R. White, J.E. Hanson, I. Whalley, D.M. Chess; and J.O. Kephart, "An architectural approach to autonomic computing", Proceedings of International Conference on Autonomic Computing, May 2004, pp. 2-9.

[3] Murch, R., Autonomic Computing, Prentice Hall PTR, 2004.

[4] D.C. Verma and S.B. Calo, "A toolkit for policy enablement in autonomic computing"; Proceedings of International Conference on Autonomic Computing, May 2004, pp. 260-271.

[5] N. Damianou, N. Dulay, E. Lupu, and M. Sloman, "The Ponder Policy Specification Language", Proceedings of the International Workshop on Policies for Distributed Systems and Networks, Lecture Notes In Computer Science; Vol. 1995, Springer-Verlag, London, UK, 2001, pp. 18-38.

[6] J. D. Moffett and M. S. Sloman, "The Representation of Policies as System Objects", Conference proceedings on Organizational computing systems, 1991, pp. 171-184.