Monday, December 24, 2012

Dependency Injection: For my Ninth Grader

Homestead High’s Astronomy Club has planned to arrange a visit to Foothill Observatory. So each student was asked to reach observatory at 9.00 AM on following Saturday. Everyone agreed. On Saturday, only quarter of the club members made to the observatory.

Club’s presiding officers were surprised that why only few students made to the observatory despite being so close to school. They decided to find out the reason, so future visits can have more participation. After talking to club members following reasons were listed for low attendance:

1. Non availability of public transport near observatory
2. Parents were busy somewhere else so no ride was available
3. Lack of coordination among students, so ride share was not common
4. …
5. ….
6. …

After few months, Club proposed to visit observatory again. But to avoid previous mistake, this time Club Officers arranged transport from School to observatory and back. Attendance rose to almost 100%.

If you notice in both scenarios only one thing has changed but results were drastically different. What was the change!!

In first scenario, each student was supposed to arrange his transport and in second scenario club officers had responsibility to arrange transport.

In second scenario students were dependent on club officers. It was up to club officers to arrange transport from First Student Charter or US Coachways any other transport company. It was possible that club officers might have arranged one bus from First Student Charter and second from US Coachways. In general students were dependent upon club officers for transport so have more time and energy to focus on learning.

This is Dependency Injection (DI).

No comments:

Post a Comment