DV Unit CMS:System Design Document

Introduction
The DV Unit CMS group will design and implement an application that will be able to store, organize, and edit data entries pertaining to persons associated with the Domestic Violence Unit in Manchester.

Subsystem Decomposition
This is a UML component diagram, where each component corresponds to a source code file or package of source code files. The relationships between subsystem components are dependency relationships, shown with dashed arrows. A dashed arrow connects the source component (which makes calls) to the target component (which has functions that are called).



Persistent Data Management
The database is named dvunit. It stores Prosecutors, Counselors, and Persons asscoiated with specific "cases" (person_cases) and counseling "programs" (person_case_program).

DV Unit uses a layered architecture that has three tiers:
 * view-control subsystem depends on the db-control and model subsystems.
 * db-control subsystem depends on the model subsystem.
 * model subsystem serves both view-control and db-control subsystems.

The user interacts only with the db-control subsystem. And the database is accessed by and returns information only to the db-control subsystem.

unit class diagram image using violet inserted here
The tables of database dvunit are:

person

A "person" is a person who has a case on file with the DV Unit in Manchester and must complete a counseling session(s). The primary key of "person" is PersonId, and is autoincremented. Other attributes are the person's name (FirstName, LastName), address (PersonAddress, City, PersonState, Zip), phone number (Phone), email, and date of birth (DOB).

prosecutor

A "prosecutor" is a prosecutor of the DV Unit in Manchester. A prosecutors deals with "cases" of "persons" who must complete a counseling session(s). The primary key of "prosecutor" is ProsecutorID. ProsecutorID is autoincremented. Other attributes are the prosecutor's name (FirstName, LastName), phone number (Phone), and email.

counselor

A "counselor" is a counselor of the DV Unit in Manchester, and acts as a facilitator of the various counseling sessions necessary to be completed by "persons" to fulfill their sentences. The primary key of "counselor" is CounselorID. It is autoincremented. Other attributes are the counselor's name (FirstName, LastName), phone number (Phone), and email.

person_case

A "person_case" is representative of a case dealing with a "person" who must complete counseling to fulfill their sentence. The primary key of person_case is CaseID. It is autoincremented. Other attributes are PersonID and ProsecutorID, which are both foreign keys in their respective tables, a sentencing date (SentenceDate), a date they must complete the counseling by (CounselingDueDate), a date that flags the system to send a warning letter after 30 days (FirstNotificationDate), and another date to send a warning letter after 60 days (SecondNotificationDate). The table is an intersection table.

person_case_program

A "person_case_program" is representative of a program that must be completed by a "person", and involves completing counseling with a counselor of the DV Unit. The primary key is ProgramID. It is autoincremented. Other attributes are CaseID, which is a foreign key associated with a particular "person_case", a type of counseling (CounselingType), CounselorID, which is a foreign key associated with a particular "counselor", a start date for the prgram (ProgramStartDate), and a counseling status (CounselingStatus).

user_name

A "user_name" represents a particular user of the system.

user_type

A user type represents a type of user.

The relationships are as follows:

prosecutor-person_case

Each prosecutor will have one-to-many person-cases. Each person_case has one prosecutor.

person-person_case

Each person will have one-to-many person_cases. Each person_case has one person.

person_case-person_case_program

Each person_case will have one-to-many person_case_programs. Each person_case_program will have one person_case.

counselor-person_case_program

Each counselor will have one-to-many person_case_programs. Each person_case_program will have one counselor.

'''This is a "child-of" dependency graph. One points to another it is the parent of.'''