ufrgs-hyman/meican — pull request #14 by jplante815 (2012-07-09 16:25:56+00:00)
Title: Driver abstraction and future support for OSCARS v0.5

CHANGE NOTES: (unless otherwise specified, the active directory is
meican/apps/circuits/models/)

1. Added class OSCARSVersionTester which allows for elevation of OSCARS
version inspection. Function checkVersion() removed from Driver and put
into this class so that depending on the underlying OSCARS version, the
appropriate concrete Driver class may be instantiated.
(OSCARSVersionTester.php)

2. In order to make the above possible, I also modified domain_info
class to include a method checkVersion() specifically for retrieving
the OSCARS version set in MEICAN. This was probably unnecessary and
could have been achieved using the existing getOSCARSDomain() function,
but this approach will provide a clearer understanding of what's
happening in the calling classes. The result of calling this function
can be directly passed into OSCARSVersionTester described above.
(domian_info.php)

3.
- Modified meican/apps/bpm/controllers/ws.php
- Modified meican/apps/topology/models/topology.php
- Modified meican/apps/circuits/controllers/reservations.php
- Modified meican/apps/circuits/models/reservation_info.php
--- The above are the classes which instantiate an object of type
OSCARSReservation. These classes all already create domain_info
objects. I have used changes 1 and 2 described above to use the
domain_info objects to get the version and then pass that version into
an object of type OSCARSVersionTester, which will return an instance of
the appropriate Driver, which replaces the original OSCARSReservation
object definitions. These modifications have been commented with my
name (2-3 lines per mod.)

4. Abstracted OSCARSReservation into abstract OSCARSDriver and concrete
OSCARSDriver05/OSCARSDriver06. Combination of OSCARSDriver and
OSCARSDriver05 provides identical behavior (with the exception of the
checkVersion mods described above) to the original v0.5 support through
OSCARSReservation.