Connascence of Execution Order
Connascence of Execution Order (CoEO) happens when the caller of a component must have some unexpressed knowledge about the correct order of the methods to be called. It is quite common in imperative languages and in the weakest of the dynamic forms of connascence. Nevertheless, it can become a source of deep pain in the maintenance phase because often it's quite difficult and time consuming to figure it out by just reading the code.
Let's see a short example of a class that is supposed to send and archive receipts:
public void SendReceipts(){ Â Â Â Â var receiptSender = new ReceiptSender(); Â Â Â Â var receiptId = NextUnsentReceiptId(); Â Â Â Â while(receiptId != null){ Â Â Â Â Â Â Â Â receiptSender.SendToCustomer(receiptId); Â Â Â Â Â Â Â Â receiptSender.Archive(receiptId); Â Â Â Â Â Â Â Â receiptId...