kanwarpreet25 c6ecf58687 508 : sonar qube critical issue fixes (#852)
* 508 : sonar qube critical issue fixes

* 508 : Sunar Qube Fixes
Define a constant instead of duplicating this literal "user_accounts" 4 times.
Define a constant instead of duplicating this literal "userID" 5 times
Define a constant instead of duplicating this literal "additionalInfo" 4 times.
Define a constant instead of duplicating this literal "userName" 4 times.

* 508 : Sunar Qube Fixes
Define a constant instead of duplicating this literal "user_accounts" 4 times.

* 508 : Sonar Qube Fixes
Define a constant instead of duplicating this literal "eEvans" 4 times
Define a constant instead of duplicating this literal "jBloch" 6 times
Define a constant instead of duplicating this literal "mFowler" 3 times

* 508 : Sonar Qube FIxes
Define a constant instead of duplicating this literal "username" 3 times.

* 508: sonar qube issue fixes
Define a constant instead of duplicating this literal "customerDao.getAllCustomers(): " 4 times.

* 508 : sonar qube issue fixes
Define a constant instead of duplicating this literal "App.main(), student : " 4 times.

* 508 : sonar Qube issue fixes
Define a constant instead of duplicating this literal "{} hits {}. {} is damaged!" 3 times.
Define a constant instead of duplicating this literal "{} hits {}." 4 times.

* 508 : Define a constant instead of duplicating this literal "{} hits {}." 4 times.

* 508 : checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: checkstyle fixes

* 508: cqrs checkstyle fixes
2019-07-28 15:39:40 +03:00
..
2017-11-28 20:55:52 +02:00
2017-11-28 21:28:53 +02:00

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Double Dispatch double-dispatch /patterns/double-dispatch/ Other
Java
Difficulty-Intermediate
Idiom

Intent

Double Dispatch pattern is a way to create maintainable dynamic behavior based on receiver and parameter types.

alt text

Applicability

Use the Double Dispatch pattern when

  • the dynamic behavior is not defined only based on receiving object's type but also on the receiving method's parameter type.

Real world examples