Skip to main content

Posts

Showing posts from June, 2013

Do your aggregates touch each others' private parts?

Most of current programming languages support access modifiers . I cannot imagine any contemporary language, which would not allow the developer to protect access to classes, methods, fields, or functions. Without them, we would not be able to maintain abstractions and encapsulation. In Java, there are four modifiers: public , protected , default , and private , in C# there is additonal concept of internal , which reffers to assembly, and in Scala, there are possibilities to fine-tune the scope with scoped private and scoped protected modifiers. Other languages, like C++, or F# for instance, also give us some possibility to modify access. They may vary from language to language, but the idea is the same - to protect parts of the code. (Actually, in C++ there is also a concept of friend , so that other class can get some private access to another class - hence the comment, that in C++ friends can touch each others' private parts... ;)  ) Looking from the time per