Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 591 Bytes

readme.md

File metadata and controls

39 lines (31 loc) · 591 Bytes

Low Level Design



Encapsulation

alt text

class Bird { string name, color, gender; public: Bird(string n, string c, string g) { name = n; color = c; gender = g; }

};

int main() {

	Bird b("gauraiya", "brown", "female");
	return 0;
}

The above code has three problem:

  1. Dirty code.
  2. Client have to remember the sequence of parameter.
  3. Backward compatibility.

Problems can be solved using Builder pattern.