Professional Documents
Culture Documents
LAB # 11 Behavioral Patterns: Null Object Pattern Objective
LAB # 11 Behavioral Patterns: Null Object Pattern Objective
LAB # 11 Behavioral Patterns: Null Object Pattern Objective
LAB # 11
Behavioral Patterns: Null Object Pattern
OBJECTIVE
Implementation of Behavioral Design Pattern: Null Object Pattern.
Exercise:
You all must be aware of the National Immunization Management system. If you are done with
your COVID vaccination, you can simply download your vaccination certificate from the
website by providing your CNIC no., and CNIC issue date. Can you apply Null Object Pattern
here for the citizens who are not done with their vaccination?
Hint: We are going to create an AbstractCitizen abstract class defining operations. Here
VaccinatedCitizen and NonVaccinatedCitizen concrete classes are extending
the AbstractCitizen class. A factory class CitizenFactory is created to return
either VaccinatedCitizen or NonVaccinatedCitizen objects based on the details of citizen
passed to it.
OUTPUT: