[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Mechanism, not policy

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Sun, 14 Jun 2015 18:37:53 +0000

Mechanism

Hi Folks,

 

Separate content from presentation. [1]

 

That is a design principle which we in the XML community have long espoused.

 

Today I learned another design principle: implement mechanism, not policy. [2]

 

Below are my notes on the mechanism-not-policy design principle. How would the design principle be applied to XML?  /Roger

 

Design Principle: Mechanism, Not Policy

 

Policy tends to have a short lifetime, mechanism a long one.

 

http://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Nuvola_apps_important.svg/1229px-Nuvola_apps_important.svg.png

 

To create code that endures, implement mechanism, not  policy.

 

Policy versus Mechanism, Example #1

 

The following example illustrates the difference between policy and mechanism: [3]

 

An office has several employees. The office has this policy:

 

All employees need to be authenticated

before entering the office.

 

The policy describes what needs to be done without specifying how it can be achieved.

 

The policy could be enforced by one or more of the following mechanisms:

 

1.       RFID reader.

2.       Retina/fingerprint scanner.


The mechanism—RFID reader or fingerprint scanner—does not impose any limitations on the access policy (which employee needs to get access to which office area). Thus we can easily support new policies such as:

 

Employees working in group A should have access

to area X only between 9 AM and 5 PM.

 

Decoupling the mechanism implementation from the policy specification makes it possible for different applications to use the same mechanism implementation with different policies. This means that those mechanisms are likely to better meet the needs of a wider range of users, for a longer period of time.

 

Hardwiring policy and mechanism together has two bad effects:

 

(a)    It makes policy rigid and harder to change in response to user requirements.

(b)   Trying to change policy has a strong tendency to destabilize the mechanisms.

 

By separating mechanism and policy, it is possible to experiment with new policies without breaking mechanisms. We can also test the mechanism independently and thoroughly.

 

Policy versus Mechanism, Example #2

 

Here’s another example to illustrate the difference between policy and mechanism: [4]

 

The X windowing system strives to provide “mechanism, not policy”, supporting an extremely general set of graphics operations and deferring decisions about toolkits and interface look-and-feel (the policy) up to the application level (final choices about behavior are pushed as far toward the user as possible).

 

 

[1] https://en.wikipedia.org/wiki/Separation_of_presentation_and_content

 

[2] http://www.catb.org/esr/writings/taoup/html/ch01s04.html

 

[3] This example comes from: https://sites.google.com/site/mylokesh/policyvsmechanism

 

[4] This example comes from: http://www.catb.org/esr/writings/taoup/html/ch01s04.html



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.