User Tools

Site Tools


principles:model_principle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
principles:model_principle [2018-12-08 11:08] christianprinciples:model_principle [2018-12-08 11:54] – example 5 christian
Line 121: Line 121:
  
 The problem here is with the A/C. Semantically it wanted to increase the motor power but actually it called an operation that hit the gas pedal. This is almost the same but not exactly the same. It's an operation on the wrong level of abstraction. If the A/C had called an operation ''increaseMotorPower'' instead of an operation ''hitGasPedal'' the problem would have been prevented.  The problem here is with the A/C. Semantically it wanted to increase the motor power but actually it called an operation that hit the gas pedal. This is almost the same but not exactly the same. It's an operation on the wrong level of abstraction. If the A/C had called an operation ''increaseMotorPower'' instead of an operation ''hitGasPedal'' the problem would have been prevented. 
 +
 +
 +==== Example 5: Inferring Information ====
 +
 +Suppose there is a smartphone app and its backend. The app lets you buy several products. One day the app developers demand that the backend adds a field describing the product size (small, medium, large). The backend developers add the field and everyone is happy. The app developers use this field so they can decide whether gift wrapping is available (large products cannot be gift-wrapped). Half a year later the company decides to enhance their product portfolio by reselling products of company B. The backend will redirect orders of B-products directly to company B so they are in charge of delivery. 
 +
 +Unfortunately B is not able to provide gift-wrappings at all. So the smartphone app has to be changed such that it not only removes the gift-wrapping option for large products but also for B-products. But smartphone apps need to be updated by the customer (and some of them never do). So the only way to ensure that gift-wrapping is handled correctly even if the customer hasn't updated yet, is that the backend returns ''size:large'' for every B product (even for small ones). 
 +
 +The ''size'' field gets deprecated and a new field ''giftWrappingAvailable'' is added. In fact that's what they should have done in the first place. The app developers needed to know if gift wrapping is available. But instead they inferred this information based on the size. This worked but it worked accidentally---and it broke accidentally. 
  
  
principles/model_principle.txt · Last modified: 2021-10-18 21:47 by christian