Implementing a Rules DSL
[ 288 ]
Roughly speaking, an access point equates to 10 cents in value, so basic
subscribers are benefiting from a 20 percent bonus versus non-subscribers.
Moreover, plus subscribers get 25 percent extra while premium subscribers
get a whopping 37.5 percent.
Media Points Type of access Out of plan price
Movies
New Release 40 Daily $3.99
Other 30 Daily $2.99
Games
New Release 30 3 days access $2.99
Other 20 3 days access $1.99
Songs 10 Download 99c
Before consumption of any media is allowed, the system does a canConsume test.
This test is passed if the user has enough access points, or if access has been granted
already to the content and has not yet expired. If the canConsume test is passed,
access to the media is granted when the first consume call is made, otherwise the user
is prompted to approve the purchase of the media, followed by the consume call for
an authorized purchase.
From the point of view of our rewards program, the APIs that we need to be
concerned with are defined in the following stub class for BroadbandPlus:
class BroadbandPlus {
boolean canConsume(subscriber, media) {
}
void consume(subscriber, media) {
}
void purchase(subscriber, media) {
}
void upgrade(subscriber, fromPlan, toPlan) {
}
}
http://www.ebook3000.com