Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

know any good examples of fine grained access control in message passing systems? sounds compelling for a current project


Message passing is the basic idea behind all method calls in OO languages, and the premise behind APIs to libraries, systems, etc. It's just a formalisation for how to make requests and communicate with another system. Even HTTP is message oriented: You can send GET, POST, DELETE etc to an HTTP server without knowing HOW it will do it. You can't browse the filesystem or read byte x of a file or anything because it's access controlled behind the interface.

It's the same in programs: You have primitives, but you generally hide them behind higher level APIs, or in the case of OO you encapsulate data and behaviour together in one place to (hopefully) make it easier for a human to conceptualise what's going on. OO is no silver bullet; it's just one way among many of organising your interfaces and data, and to make combinable components that increase the expressivity and thus power of your codebase.

In the previous example, client code was looking inside data "user" to check if a particular thing exists in its "blocks" data, but it would be better to work at a higher conceptual level, such as a function/method/message called "has this user blocked user X? (returns yes or no)". Then when someone reads that code later, they can at-a-glance see what the program is doing conceptually, rather than scanning around to figure out what the code is doing with "blocks" and work out what it's attempting to accomplish.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: