add function for observer design

Signed-off-by: szmlb <as.personalutility@gmail.com>