Sie sind auf Seite 1von 10

Carmelite Cooper HR System

Cobalt Practicum 1-1


Code Generator (Easy)

Allan S Sta Cruz

March 2016
Table of Contents

The Premise..............................................................................................................................................1
The Requirements..................................................................................................................................1
The Database Schema...........................................................................................................................2

Section 1: The Code Generator, Part 1..................................................................................................3


Create the Project..................................................................................................................................3
Import the Tables...................................................................................................................................3
Configure the Fields..............................................................................................................................3
Define the Relationships.......................................................................................................................4
Last-Minute Edits..................................................................................................................................5
Section 1 Checklist................................................................................................................................5

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.

Asia Pacific College Consulting Services Office 1 | Page


[March 2016]

The Database Schema

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.

Asia Pacific College Consulting Services Office 2 | Page


[March 2016]

Section 1: The Code Generator, Part 1

Create the Project

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.

Import the Tables

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:

Folder / Subdirectory Name Tables


Plantilla plantilla

Employee employee, employee_license, employee_education,


employee_family, employee_work_expereince, employee_reference

Table 1: hr_schema's folder/subdirectory setup

Configure the Fields

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,

Asia Pacific College Consulting Services Office 3 | Page


[March 2016]

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.

Define the Relationships


Finished with the table fields, you move on to defining the relationships between tables in your Cobalt
project. Looking at your database schema once again, you define the following relationships as
necessary for your application:

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

Asia Pacific College Consulting Services Office 4 | Page


[March 2016]

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:

1. Create the HR - EM Project, name it 'Human Resources - Employee Management System'


2. Connect to the database called 'hr_schema' with 'root' as the user, no password used.
3. Import all the tables and assign them to their respective folders / subdirectories: Plantilla:
plantilla; Employee: employee, employee_license, employee_education, employee_family,
employee_work_experience, employee_reference

Asia Pacific College Consulting Services Office 5 | Page


[March 2016]

4. Change the length of age of the employee table from 11 to 3.


5. Change the labels of employee_first_name, employee_middle_name, employee_last_name,
employee_nickname of the employee table from 'Employee First Name' to 'First Name',
'Employee Middle Name' to 'Middle Name', 'Employee Last Name' to 'Last Name', 'Employee
Nickname' to 'Nickname' respectively.
6. Change the control type of present_address of the employee table from textbox to textarea
7. Change the labels of sss_no and tin of the employee table from 'Sss No' to 'SSS Number' and
'Tin' to 'Tax Identification Number' respectively.
8. Change the length of sss_no of the employee table from 255 to 10
9. Change the length of tin of the employee table from 255 to 12
10. Change the labels of family_first_name, family_middle_name, family_last_name of the
employee_family table from 'Family First Name' to 'First Name', 'Family Middle Name' to
'Middle Name', 'Family Last Name' to 'Last Name' respectively.
11. Change the control type of date_acquired of the employee_license table from textbox to date
controls
12. Change the control type of job_description of the plantilla table from textbox to textarea
13. Create a ONE-to-ONE relationship between plantilla_id of plantilla table and plantilla_id of
employee table. Subtext is position_title.
14. Create a ONE-to-MANY relationship between employee_id of employee table and
employee_id of employee_license table.
15. Create a ONE-to-MANY relationship between employee_id of employee table and
employee_id of employee_family table.
16. Create a ONE-to-MANY relationship between employee_id of employee table and
employee_id of employee_work_experience table.
17. Create a ONE-to-MANY relationship between employee_id of employee table and
employee_id of employee_reference table.
18. Create a ONE-to-MANY relationship between employee_id of employee table and
employee_id of employee_education table.
19. Generate the entire project then copy to the web root.
20. Go back to the code generator then change the control type of recruitment_notes of the plantilla
table from textbox to textarea.
21. Create a ONE-to-ONE 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
22. Create a ONE-to-ONE relationship between employee_id of employee table and employee_id
of employee_family table. Subtext is employee_first_name, employee_middle_name,
employee_last_name

Asia Pacific College Consulting Services Office 6 | Page


[March 2016]

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.

Asia Pacific College Consulting Services Office 7 | Page


[March 2016]

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,

The Cobalt Team

Asia Pacific College Consulting Services Office 8 | Page

Das könnte Ihnen auch gefallen