Figure 1: CRC Card Model for Patch Management System

config
  • a simple application configuration layer.
Properties
 
Methods
+get(): hash ref
Collaborators
 
DBA
  • a simple but powerful interface to DBI with some MySQL-isms.
  • provides automatic disconnection from database.
  • provides methods to retrieve a solitary row from a table.
  • provides methods to loop through all rows matching a query.
Properties
+err: number
+errstr: string
Methods
+new($rh): DBA
+table_exists($table): bool
+do($sql, $rhAttr, @bind_values): integer
+one_row_array($sql, @bind_values): array ref
+one_row_hash($sql, @bind_values): hash ref
+each_row_array($sql, &code, @bind_values): number
+each_row_hash($sql, &code, @bind_values): number
-DESTROY()
Collaborators
DBI
Carp
DBPatch
  • A base class for implementing a database patch module.
  • Provides methods for listing patches, checking dependency relationships and creating/dropping the patch management table.
  • Derived classes are responsible for implementing database operations to apply and backout the actual changes to the database.
Properties
+is_intialized: bool
+dba: DBA
#_patch_number: integer
#_patch_description: string
#_patch_can_undo: bool
#_patch_dependencies: array ref
Methods
+new($db: DBA): DBPatch
+check_patch($patch_number): bool
+check_backed_out($patch_number): bool
+patch_info(): hash ref
+patch_list(): hash ref
+apply()
+backout()
+check_dependencies()
+create_patch_table()
+drop_patch_table()
#_do_patch()
#_undo_patch()
-__set_patch($patch_number, $description, $can_undo)
-__backout_patch($patch_number)
-__patch_entry($patch_number): bool
-__check_init(): bool
Collaborators
DBA
Carp
patchdb.pl
  • A simple patch management utility.
Properties
 
Methods
+usage()
+list_patches()
+check_patch($patch_number)
+apply_patch($patch_number)
+backout_patch($patch_number)
+load_patch($patch_number)
Collaborators
DBPatch
config
Legend:
+public_method(parameter: parameter type): return type
#_inheritable_method(parameter: parameter type): return type
-__private_method(parameter: parameter type): return type