96 days ago · Tech · hide · Fediverse post

Here my previous post about encapsulation, the primary purpose of which is to argue for the importance of the concept. Here are some realistic, important violations of encapsulation: Using a system that requires the properties or attributes of a runtime object to correspond one-to-one with the columns or fields of persisted objects. (E.g., DynamoDBMapper or Django models.) These extra dependencies between subsystems cause all sorts of problems. So, for example, your code-level objects often become hard to reason about, and you can cause performance problems by making innocuous-seeming code changes.) Decoding an API response directly in a React component and feeding something like response.hats to a sub-component. This kind of dependence between the over-the-wire representation and component mechanics can cause a lot of trouble,1 and commonly does.2 Having a function that says (in its name, a docstring, or anywhere else) it returns all objects meeting criterion X, but silently dropping…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town