What are the differences between information hiding and encapsulation?

Encapsulation and information hiding are very closely linked concepts, though their precise definitions vary depending on who you talk to. The concept of “information hiding” was first described by Parnas (1972) who suggested that access to information should be restricted to reduce the interconnectedness of a system. He proposed that this would facilitate splitting of … Read more

What are the differences between the private keyword and private fields in TypeScript?

Private keyword The private keyword in TypeScript is a compile time annotation. It tells the compiler that a property should only be accessible inside that class: class PrivateKeywordClass { private value = 1; } const obj = new PrivateKeywordClass(); obj.value // compiler error: Property ‘value’ is private and only accessible within class ‘PrivateKeywordClass’. However compile … Read more

method without access modifier

The default accessibility for a type is internal, but the default accesibility of that type’s members depends on the type. Generally speaking, members of a class are private by default, where as members of a struct are public by default. This varies by language; default struct access modifiers for C++ are public, where as for … Read more

Using a strategy pattern and a command pattern

I’m including an encapsulation hierarchy table of several of the GoF design patterns to help explain the differences between these two patterns. Hopefully it better illustrates what each encapsulates so my explanation makes more sense. First off, the hierarchy lists the scope for which a given pattern is applicable, or the appropriate pattern to use … Read more

SQL Server: How to permission schemas?

I fear that either your description or your conception of Ownership Chaining is unclear, so let me start with that: “Ownership Chaining” simply refers to that fact that when executing a Stored Procedure (or View) on SQL Server, the currently executing batch temporarily acquires the rights/permissions of the sProc’s Owner (or the sProc’s schema’s Owner) … Read more