Monday, February 4, 2008

Rejoining the land of the living

I took a beating from the flu (or some other nasty bug) during the later half of last week. I've regained most of my ability to use the higher functions of my brain, so I'm now trying to dig myself out from the hole that I'm in.

I've re-read the most juicy bits of the Observer chapter and come up with my recipe for the pattern which will be posted in the next entry. I started using the Java implementation of Observer in the version of my project that I have emailed in, but want to implement my own Observer and Subject interfaces instead. I will continue to hammer away at getting the Observer pattern implemented naturally in two places.

The most obvious place I can think of putting it is to allow antivirus to monitor the computers on the simulated network. The antivirus will be updated whenever a virus tries to infect a computer and if it is enabled, will disinfect the computer before the virus has a chance to mess anything up. Where I'm running into trouble now is where to have the second implementation of the pattern. Once idea that seems decent is to let viruses of the WormVirus class observe the firewalls of computers that they are port-scanning, and be notified of ports when they become open.

Do these two spots sound like good uses of the Observer pattern?

No comments: