Professional Documents
Culture Documents
Carmelite Cooper HR System: Cobalt Practicum 1-1 Code Generator (Easy)
Carmelite Cooper HR System: Cobalt Practicum 1-1 Code Generator (Easy)
March 2016
Table of Contents
The Premise..............................................................................................................................................1
The Requirements..................................................................................................................................1
The Database Schema...........................................................................................................................2
Congratulations!.......................................................................................................................................8
[March 2016]
The Premise
You are an indie software engineer who has been contracted by a medium-sized organization called
Carmelite Cooper Inc. They are in need of a Human Resources system to manage employee
information and along with it keep track of their company's organizational structure. Initial
requirements gathering meetings have been conducted and you decided to apply your newfound skills
in the Cobalt framework to quickly build a working application prototype and have it deployable
shortly afterwards.
The practicum is divided into major "deliverable" sections, each representing ongoing meetings and
collaboration with your HR contact in Carmelite Cooper. With each section you will be expected to
submit a copy of your Cobalt project and have it checked before proceeding to the next section.
In this first section of the practicum, you have just finished your initial data gathering from your
contact at Carmelite Cooper. With the requirements and the database schema at hand, you will be
expected to present an initial prototype version of the application after configuring and generating it via
Cobalt's powerful code generator.
The Requirements
Carmelite Cooper has a very straightforward set of requirements for their HR system. It can be
summed up into two major modules:
Employee Management they want to be able to manage an employee's full 201 information in
the application, which includes their personal information, family background, educational
attainment, accreditations and licenses, previous work experiences, and their list of references.
Organizational Chart / Plantilla Management part of employee information would be
determining what their position is within the organization, so they would also want to be able to
define the hierarchy of positions that exist within the organization, from the CEO at the topmost
position to the lowest rank-and-file position of employees.
They have given you sample documents that detail the employee information fields you need to
construct the database and have provided you with information that they need to store as part of the
company's organizational chart fields.
In preparation for building your Cobalt application, you constructed the database schema that you will
need to feed into the Cobalt Code Generator. Based on the information and fields that Carmelite
Cooper has provided, you have come up with this ERD of the database schema (the actual SQL file of
the database schema itself has been provided along with this practicum document).
Having been satisfied with this schema, you load it up into your development environment database
called 'hr_schema'. Now you proceed with configuring the application in the Cobalt Code Generator.
Recalling your Cobalt training, the first step you do is create a Cobalt Project for the Carmelite Cooper
HR System. You then connect to the 'hr_schema' database, providing the requisite login credentials to
Cobalt so that it can import the application tables that you have specified earlier.
As Cobalt imported the 7 tables, you decide that as early as now you should organize your tables into
their respective major modules so that when you have need to modify the source codes that Cobalt will
eventually generate, you will have little difficulty sifting through the files. Using the two major module
groups you defined, you sort out the tables into two folders/subdirectories:
Satisfied with that setup, you import the tables and move on towards configuring the various fields that
Cobalt has imported from your database. An initial sweep of the fields have yielded several concerns
that you believe should be corrected as early as now before the project itself is generated:
On the employee table, the age field's length is 11, as dictated by Cobalt when it saw that your
database field for age has a size of 11. You're quite confident that an age field would never
require a value that is 11 integers long, so you set it to an appropriate value - 3 should be
enough.
Since Cobalt labels its fields according to how they have been named in your database schema,
some of them may be too cumbersome or nondescriptive of the fields that they are supposed to
represent. On the employee table, for instance, the employee's name fields
employee_first_name, employee_middle_name, and employee_last_name have all had their
labels created as Employee First Name, Employee Middle Name, and Employee Last Name
respectively. You decide to trim down the 'Employee' parts of the labels and just retain the First
Name, Middle Name, and Last Name fields respectively.
On the employee table, the present_address field has been rendered by Cobalt as a textbox. You
are expecting a value that would likely surpass the character display limits of a textbox, so you
opt to change the field instead to a textarea.
On the employee table, you note that the fields for government ID numbers, sss_no and tin_no,
have had their labels transformed as Sss No and Tin label values that are hardly presentable.
You decide to formalize their labels to their appropriate ones SSS Number and Tax
Identification Number. Also, you note their their lengths have been set at 255 too long for
such fields. You set the sss_no field's length to 10 and the tin field's length to 12, which are their
maximum lengths respectively.
On the employee_family table, a similar concern with the employee table has come up with
regards to the labels of the family members' name fields. Similar to how you did it in the
employee table's name fields, you trim down the 'Family' parts of the labels and just retain the
actual name of the fields themselves.
On the employee_license table, the date_acquired field has been rendered by Cobalt as a
textbox. You are expecting a date value for this field that is in a specific format and want to
avoid user error in inputs. You decide to transform this instead to a date controls control type so
that users will only need to select the date values for month, day, and year from a series of drop-
down lists.
On the plantilla table, the job_description field has been rendered by Cobalt as a textbox. A job
description would naturally be a lengthy description of the position itself, so you opt to
changethe field instead to a textarea.
The employee table's plantilla_id field should be linked with the plantilla_id field of the
plantilla table in a 1-1 Relationship. You decide that the appropriate subtext to use for this
relationship would be the plantilla table's position_title field.
As the employee table can have multiple related entries to the employee_family,
employee_education, employee_license, employee_work_experience, and employee_reference
tables, you link the employee table to each of these ones in a 1-M Relationship.
The plantilla table has been structured as a table with a recursive relationship to itself, as
referenced by the field parent_plantilla_id. You link the plantilla_id field with this field in a 1-1
Relationship, using the plantilla table's position_title field as an appropriate subtext.
Having done these changes, you go on and generate the Cobalt project itself, generating all the files
needed as it is the first generation of the project. You move it to your webroot directory and install the
additional tables required by Cobalt for your application for it to be fully recognized as a Cobalt-ready
database.
Last-Minute Edits
As you are about to make the next presentation at Carmelite Cooper, you realize with a last-minute
sweep of the system that you have missed a field that needed attention - the recruitment_notes field of
the plantilla table behaves in a manner similar to the job_description field, which means it should also
be transformed into a textarea, not a textbox.
Similarly, as you were exploring the modules for Employee Family, Employee Education, Employee
License, Employee Work Experience, and Employee Reference, each one is returning an error
something about missing relationship information. It would be disastrous if you were to present this
system in a few minutes!
Fortunately it just means that you missed out on defining the 1-1 Relationship from the affected tables
(employee_family, employee_education, employee_license, employee_work_experience, and
employee_reference) to the employee table itself. You decide that the appropriate subtext for these
relationships would be a combination of the employee table's employee_first_name,
employee_middle_name, and employee_last_name fields.
You make these last-minute changes, re-generate the project, though this time only generating the table
subclass and module that you made edits of, then update your webroot directory. With that you're set to
showcase the first prototype of your Cobalt project to Carmelite Cooper!
Section 1 Checklist
As you prepare for your first presentation to Carmelite Cooper, you make notes of the things you have
done so far to achieve your first-ever generated Cobalt prototype of the HR System:
23. Create a ONE-to-ONE relationship between employee_id of employee table and employee_id
of employee_work_experience table. Subtext is employee_first_name, employee_middle_name,
employee_last_name
24. Create a ONE-to-ONE relationship between employee_id of employee table and employee_id
of employee_reference table. Subtext is employee_first_name, employee_middle_name,
employee_last_name
25. Create a ONE-to-MANY relationship between employee_id of employee table and
employee_id of employee_license table. Subtext is employee_first_name,
employee_middle_name, employee_last_name
26. Generate the project again but this time generate the plantilla subclass and modules only.
Overwrite existing plantilla subclass and modules.
Congratulations!
You stretch back on your chair as you finish the last of the code generator configuration options and
generate the first working prototype of Carmelite Cooper's HR System. You go through the core
features of the application to check that everything is working as intended and, after being sufficiently
satisfied with everything, wrap it up for the day and prepare for the upcoming presentation with your
contact at Carmelite Cooper the following day.
The first section of this practicum is finished. You have just taken your first step towards the mastery of
the Cobalt framework and code generator.
Sincerely,