Meeting Thinking and Coding - Internship Report

download Meeting Thinking and Coding - Internship Report

of 48

Transcript of Meeting Thinking and Coding - Internship Report

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    1/48

    Internship Report:Meeting, Thinking and Coding (MTC)

    Personal Edition

    September 16, 2002Sasmito Adibowo

    Faculty of Computer ScienceUniversity of Indonesia

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    2/48

    2

    ABSTRACT

    MTC (Meeting, Thinking, Coding) is an activity monitoring software developed byPT Code Jawa to record the daily activities for computer-intensive workers.

    Targeted for business-Windows platforms, this program is developed initially for

    Code Jawas internal use. Further product path of the system will be commercialmarketing of the system.

    This report describes the internship period in which the intern developed theMTC system. Along with the system description of MTC, the report also includesthe company profile, project execution, impact analysis and it is finallyterminated with several conclusions and suggestions by the intern.

    With courtesy of Code Jawa, this report is made available for the general publicunder the GNU Free Documentation License. A copy of this license is provided inthe appendices.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    3/48

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    4/48

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    5/48

    5

    T ABLE OF C ONTENTS

    1 Foreword................................................................................................................................................ 71.1 Background .........................................................................................................................7

    1.2 Job Description and Internship Objective...........................................................................7 1.3 Report Organization............................................................................................................7

    1.3.1 Company Profile .................................................................................................................................................... 81.3.2 System Description ................................................................................................................................................ 81.3.3 Project Execution ................................................................................................................................................... 81.3.4 Impact Analysis...................................................................................................................................................... 81.3.5 Concluding Remarks.............................................................................................................................................. 8

    2 Company Profile.................................................................................................................................... 92.1 Brief History........................................................................................................................92.2 Mission ................................................................................................................................92.3 Core Strategy.....................................................................................................................10

    2.3.1 Talent .................................................................................................................................................................... 102.3.2 Team..................................................................................................................................................................... 102.3.3 Talk ....................................................................................................................................................................... 112.3.4 Tech....................................................................................................................................................................... 112.3.5 Trust...................................................................................................................................................................... 11

    2.4 Development Methodology................................................................................................112.5 Core Competencies ...........................................................................................................12

    2.5.1 Mobile Applications............................................................................................................................................. 122.5.2 Online Payment and Banking Solution............................................................................................................... 122.5.3 Custom Server-side Component Development .................................................................................................. 12

    2.6 Company Culture ..............................................................................................................122.7 Organization Chart ...........................................................................................................13

    3 System Description.............................................................................................................................. 143.1 Development Methodology................................................................................................143.2 Product Functions.............................................................................................................14

    3.2.1 Use Cases.............................................................................................................................................................. 153.3 Scope .................................................................................................................................153.4 System Architecture...........................................................................................................16 3.5 System Components...........................................................................................................17

    3.5.1 Agent..................................................................................................................................................................... 173.5.2 Client..................................................................................................................................................................... 19

    3.6 Database Design ...............................................................................................................193.6.1 Working Tables.................................................................................................................................................... 20

    Project ................................................................................................................................................................................ 20Application......................................................................................................................................................................... 21

    project_application ............................................................................................................................................................ 21 project_status ..................................................................................................................................................................... 22 project_activity_type ......................................................................................................................................................... 22 project_activity .................................................................................................................................................................. 23 project_folder..................................................................................................................................................................... 23 project_file ......................................................................................................................................................................... 24application_project_file..................................................................................................................................................... 24

    3.6.2 Template Tables ................................................................................................................................................... 25Project_template................................................................................................................................................................ 25Project_template_folder.................................................................................................................................................... 26Project_template_activity_type......................................................................................................................................... 26

    3.7 Behavioral Model and Description ...................................................................................27

    3.7.1 Application Events............................................................................................................................................... 27Application Switch............................................................................................................................................................ 27Power Change.................................................................................................................................................................... 27

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    6/48

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    7/48

    7

    1 Foreword

    1.1 Background

    The need to measure a software development effort is increasing, proportional tothe importance of software systems in todays businesses. In such efforts, bothemployers and clients need to keep track their progress to ensure that theyregetting their moneys worth. But money spent in software development projects isoften difficult to correlate with the effort given by the developers let alonelinking it with the projects progress.

    Traditionally, the developers are required to hand in a periodic written report totheir managers. Using these reports, the manager then relays the information tothe clients or employers (depending on whether it is a contracted or in-house

    project). The system works well to some extent, but it has at least two drawbacks.First, the information contained in the reports is often incomplete, distorted andheavily filtered. Second, programmers often view writing reports as an overhead and indeed it is which sometime impedes productivity.

    As a software development company, Code Jawa attempts to address this issueby providing a software solution. It is an automated work-tracking software thatlogs a programmers day working in one or more software projects. Called MTC,the software may also be generalized for use by other computer-intensiveknowledge-workers.

    1.2 Job Description and Internship Objective

    The intern was assigned to design and implement the MTC system. Design of thesystem was continued from a previous project that was postponed.

    As a temporary employee, the intern only receives an hourly wage, withoutadditional benefits normally provided to full-time employees.

    1.3 Report Organization

    The report is written to fulfill one of the requirements imposed on all internshipcourses by the faculty. It serves the readers to gain an insight on the internshipperiod done by the writer.

    Other than faculty requirements for the report, the organization on which theinternship took place has another requirement. All written communication anddocuments within the company are in English. Therefore, this report is also

    written in the language.

    Following this section, organization of the report is as follows:

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    8/48

    8

    1.3.1 Company Profile

    This section describes the organization in which the internship took place. Itarticulates a brief history of the organization, mission, strategies, corecompetencies and culture.

    1.3.2 System Description

    This section describes the product of the work that was done during theinternship period. It is a subset of the System Description document producedduring development.

    1.3.3 Project Execution

    This section describes the projects execution during the internship. It providesthe initial timeline when the project was planned and the actual timeline when it

    was executed. Provided along with the timelines are the grounds on why thetimeline was set, taking human factors into account

    1.3.4 Impact Analysis

    This section provides an analysis by the writer on the impact of the project to theorganization.

    1.3.5 Concluding Remarks

    This section articulates the writers opinion on the internship experience as anoverall. Additionally, the writer provides several suggestions for both theorganization and for further development of the product.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    9/48

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    10/48

    10

    To provide a value-optimized software development outsourcing option,recognized for excellence throughout the world.

    It intends to fulfill its mission by:

    Combining Indonesia's most talented programmers with internationally-trained, highly- experienced Project Managers and Design Consultants;

    Assembled and managed under proven high-tech leadership emphasizing adisciplined yet flexible development model;

    Creating a collaborative, communications-oriented, client-vendorrelationship that extends through the software development life-cycle;

    Bridging the physical and conceptual distance between the East and Westand leveraging the strengths of both in generating creative, effective, andinexpensive software solutions for the clients.

    2.3 Core Strategy

    Code Jawa relies on a unique 5 T strategy: Talent, Team, Talk, Tech and Trust.Being the basis for its corporate culture and business approach, this strategyenables the company to be comparable to those in the US or Europe. Its

    Jawanese Magic combines the east to the west utilizing Indonesias finestprogrammers and design consultants with US management and standards.

    2.3.1 Talent

    From design specialists to programmers, each staffs talents are measured fromhis or her credentials, capability, and creativity. Credentials must include aninternational or local tier-one university degree in Computer Science/Engineeringand proven development experience with a high technology company. Capabilitiesmust include mastery of various programming technologies, and may requireproven design and project management expertise with an international company.While creativity is defined as the skill that effectively uses knowledge in order todevise out-of-the-box solutions. This fuzzy factor differentiates a Code Jawaprogrammer from everyone else.

    2.3.2 TeamCode Jawa teams combine talent and organization to create performance. Projectteams are constructed to meet specific objectives. Using best practicesmanagement, each team member is focused to the clients needs and projectobjectives. When the projects schedule is agreed upon, the team recognizes thatthey need to put in more time should they fall behind. After the project, the teamis rated both individually and collectively. This means that the teams structure isnot a way to avoid responsibility, but to generate greater productivity andaccountability.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    11/48

    11

    2.3.3 Talk

    Communications are fundamental to Code Jawa. Clients are always engaged inactive talk with the development team, through phone calls and othercommunication methods. Should the need arise, the teams schedule will beadjusted to overlap the clients time zone.

    In Code Jawa, communication skills are rated on a par with programming skills.Since a lot of talk avoids mistakes and helps in creating better software.

    2.3.4 Tech

    While creating software that meets clients needs is the ultimate goal, Code Jawaalso takes responsibility to make sure that it is on the cutting edge of technology.State-of-the-art technologies are combined with experience across a variety of functional needs to generate world-class software. It is done using a techniquethat they call the Jawanese Magic .

    2.3.5 Trust

    Being a software development company that are often handed with highlyconfidential proof-of-concept prototyping projects, intellectual property rights isan important issue in Code Jawa. Often, temptations are imposed on theemployees to recognize that a new idea that clients have entrusted to Code Jawafor development is a "big idea." Like programmers in the US and Europe, thetemptation may at times are too great. Therefore, the company have verystringent policies on how coding is done to ensure that highly sensitive materialsare handled only within its offices. Employees are routinely reminded of theresults of any breach of client's confidentiality, including immediate dismissaland aggressive criminal action.

    2.4 Development Methodology

    Code Jawa focuses on a hybrid Iterative/Evolutionary SDLC that proceeds fromspecification to design through an iterative construction phase. Only when thefinal design is agreed upon, then they move on to final coding, qualifying anddeployment. This ensures that lessons learned during prototyping can beincorporated as new specifications leading to needed design changes before final

    delivery. The goal is to deliver the software that clients actually need and then tobe there for the next phase evolution.

    Figure 1 Code Jawa SDLC

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    12/48

    12

    2.5 Core Competencies

    Code Jawas core competencies roots from its vast experience in developing IT solutions. Although most of its projects are rapid prototyping, proof-of-conceptsolutions, often clients renew the contract to include construction of the finalsystem for deployment or commercial use.

    The following lists the main areas of Code Jawas core competencies:

    2.5.1 Mobile Applications

    Mobile portal with SMS, Interactive SMS, WAP and VRU delivery channels

    Custom handheld applications on Palm and Pocket PC;

    Mobile location personalization

    Subscriber acquisition, management, and administration businessprocesses

    Third party rating processes - micro-billing

    Profiling and dynamic content management and delivery

    2.5.2 Online Payment and Banking Solution

    End-to-end mobile banking based on WAP and SIM Toolkit

    End-to-end Internet banking

    Payment gateway solutions for banks and online/offline merchants

    2.5.3 Custom Server-side Component Development

    Server-side components are the heart of Code Jawas solution framework.Collectively called the Code Jawa Applications Framework (CJAF), they are looselycoupled components existing independently across multiple servers. Togetherthey provide foundations for myriad solutions such as:

    E-Business and E-Commerce

    Back-end, legacy system integration business information systems Custom XML-based browser applications

    Personalized content management and delivery systems

    2.6 Company Culture

    Code Jawa has a loosely-bound culture office formality is not consideredessential by its employees. To enhance creative atmosphere, the management

    does not pose artificial barriers to the programmers. As an element of its corestrategy, Code Jawa emphasizes on strong internal communications in its

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    13/48

    13

    development team. The programmers are encouraged to discuss their issues withtheir colleagues; even those colleagues that are not directly related to his project.

    2.7 Organization Chart

    Code Jawa focuses on a team-based organization structure. This structureresults in a compact chain of command with minimal bureaucracy. In correlation

    with the talk part of the 5 Ts strategy, each member of the team is freely able toconsult freely to other members even though the consulted team member is notrelated to the particular project.

    Craig OwensbyCEO

    Iwan TantraCTO

    Krishna W KarangProject Manager

    DionSoftware Engineer

    Stephen Tahjar Software Engineer

    Johan CindraSoftware Engineer

    Isak RickyantoSoftware Engineer

    DenymonSoftware Engineer

    Ryan WijayaWeb Designer

    The intern was placed in the team as a Software Engineer Intern. This position isequivalent to other software engineers only differing in terms of pay, work times,and benefit policies.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    14/48

    14

    3 System Description

    This section describes the product of the work that was done during theinternship period. It is a subset of the System Description document producedduring development.

    The internship assignment in Code Jawa was to implement the prototype versionof MTC. Regarded as a personal edition, this is proof-of-concept prototype is to beused internally in Code Jawa offices. On its success, Code Jawa will continue thedevelopment of the full-fledged enterprise version for commercial use.

    3.1 Development Methodology

    The development of MTC follows Code Jawas iterative evolutionary model.

    Initially, a Functional Description and System Requirements Specification document is written to establish the initial specification of MTC. Then thedevelopment continues iteratively in a bottom-up manner, developing the low-level components and core functionalities prior to other functionalities.

    3.2 Product Functions

    MTC is a system that allows a company to monitor its project resources. The termresources would be interpreted as human resources , time resources andinformation resources . MTC is not made to be a supervisor for each project teammember, but it is made to optimize progress by monitoring some significant variables of an ongoing project , which are: Applications that are used by each team member within a day Time activities on employees workdays (how do they spend their working time?) At the end of each project, MTC would be able to create a report that shows the

    working pattern of each team member (what application that is mostly used, whatkind of activity that they mostly spend), and another report to the client thatinclude chargeable times for invoice purposes.

    The goal of MTC is to provide reports that: Show the daily activities of the employee. Show how much time spent on each kind of activity. Show the activities done on a project and how much time spent in it.

    This information would allow managers to gain input on efficiency improvementas well as justifying work product to clients.

    The main advantage of MTC compares to other project management tools oractivity-tracking tools is that with MTC users are occasionally reminded to enterin ongoing activities as it happens. This feature overcomes the problem withtraditional activity tracking system. With traditional tools, the users will have to

    intentionally open the system and manually enter in work information, which isdone at the end of the day -- or worse, accumulated at the end of the week.Accuracy of this method is obviously questionable because most programmers

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    15/48

    15

    hate to document. With MTC, documentation is done subconsciously during worktime.

    3.2.1 Use Cases

    Query Application Usage

    Report

    Create Project

    Project Profile

    Edit Project

    Query Idle Time

    MTC System

    generate

    MTC User

    view

    Log current activity

    The MTC system queries the users activities while he/she is working on thecomputer. It occasionally asks the user What you were doing? and recordsvarious states of the computer at the time. It also records the start/stop times of the activities and categorizes those activities. The user may also explicitly askMTC to record the current activity.

    Activities are related to a project. Therefore, MTC provides basic functionalities tocreate and modify project data. This includes a projects profile and otherinformation regarding the project.

    The activity data are then used to generate reports in various views. It serves toassess the users activities on various projects. Reports may be generated at anytime, and are based on the currently available data.

    3.3 Scope

    MTC Personal Edition focuses on monitoring the activities for an employee during work time. It is meant to be personal placing the user at the center of thesystem, providing full control on it.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    16/48

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    17/48

    17

    Placed in the dynamic-link library mtcagent.dll , the agent module listens to thesystems messages by inserting itself into Windows global hook chain. It is calledby Windows at several events, and then the client module is notified of that eventas requested.

    The client module receives agent notifications and then processes thosemessages. Located in the main executable, mtcclient.exe , it implements the entireuser interface, the business logic, and the data access objects layers. Agentmessages are received by the main window, processed by the business logic,

    which then may manipulate the database using the data-access objects.

    The main window listens for agent messages posted in its message queue. Theagent messages are received in the form of a user-defined window message. Uponreception of this message, the main window decodes it and then calls theappropriate method in the business logic layer.

    The business logic layer contains the business-processing parts of MTC. Apartfrom receiving event notifications from the main window, it also runsautonomously as a different thread separate from the main user interface.

    The data access object layer manages the interaction between the business logicand the database. It handles data-manipulation requests from the business logicand implements them as SQL queries to the local database.

    The personal edition of MTC uses a local (file-based) database. This allows MTC tobe used without requiring a database server. The local database uses the BorlandParadox database engine, the default engine provided with Borland C++ Builder,the development environment used in constructing MTC.

    Each user of MTC owns a copy of the schema instance. In this setup, databasesecurity is enforced by the operating system by protecting the data files that

    make up the database.

    3.5 System Components

    3.5.1 Agent

    As previously described, the agent module is a dynamic-link library whichimplements callback functions that monitors events in the Windows global hook chain . It installs WH_CBT, WH_KEYBOARDand WH_MOUSEhooks.

    processboundary

    LocalDatabaseAgent

    hooknotifications

    MainWindow

    windowmessages

    methodcalls

    BusinessLogic

    Data-AccessObjects

    methodcalls

    SQLqueries

    WindowsSystem

    mtcagent.dllmtcclient.exe

    BDE Engine

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    18/48

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    19/48

    19

    AM_MOUSE The mouse was moved or its buttons was pressed.

    3.5.2 Client

    The client receives agent notifications via its main window, TFrmMain . The main window processes the notifications and then calls the appropriate methods in the

    business logic layer. Classes in the business logic then manipulate the databasethrough the classes in the data access object layer.

    MonitoringState

    MonitoringState1

    MonitoringState2

    MonitoringState3

    MonitoringStateIdle

    State_A

    State_B

    State_C

    State_D

    State_E

    State_F

    ActivityStateActivityContext11 11

    TFrmMain ActivityMonitor 11 11

    1..1 1.. 1

    The business logic that interfaces with the main window is the ActivityMonitorclass. It is a thin wrapper around an instance of ActivityContext , which the latteris an active class descended from the VCL TThread class.

    Business processing is primarily done in the ActivityContext class. It is anextended state machine implemented by employing the state pattern . The statemachine runs in its own thread, separate from the user interface. Each of thestate class is a singleton class , subclass of ActivityContext . These singletonclasses stores their data not in their own instances, but as member variables in

    ActivityContext .

    The data access classes are ProjectDAO and ApplicationDAO . These classes performthe database manipulation upon request of the classes in the business logiclayer. Their operation is supported by value objects that functions as object-oriented counterparts of the database records.

    3.6 Database Design

    This section describes the database schema of MTC. It lists the tables, its fieldsand the relations between those tables.

    The personal edition of MTC uses a local (file-based) database. This allows MTC tobe used without requiring a database server. The local database uses the built-inBorland Paradox engine. The field types are specified using Paradoxs type names.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    20/48

    20

    Each user of MTC owns a copy of the schema instance. In this setup, databasesecurity is enforced by the operating system by protecting the data files thatmake up the database.

    3.6.1 Working Tables

    This section describes the tables actively used by MTC during its operation. Thesetables are continuously updated while MTC is running.

    projectproject_id: AUTOINC

    status_id: AUTOINC (FK)project_name: VARCHAR(40)description: BLOB(1,1)project_start: Timestampproject_finish: Timestamproot_folder: Alpha(18)dt_lastchanged: Timestamp

    project_activityproject_id: AUTOINC (FK)activity_id: AUTOINCactivity_type_id: AUTOINC (FK)

    application_id: AUTOINC (FK)folder_name: VARCHAR(255) (FK)file_name: VARCHAR(255) (FK)description: BLOB(1,1)activity_start: Timestampactivity_finish: Timestampdt_lastchanged: Timestamp

    project_folder project_id: AUTOINC (FK)folder_name: VARCHAR(255)

    folder_exists: BOOLEANdt_lastchanged: Timestamp

    applicationapplication_id: AUTOINC

    executable_file: VARCHAR(255)application_name: VARCHAR(255)description: BLOB(1,1)file_exists: BOOLEANdt_lastchanged: Timestamp

    project_applicationapplication_id: AUTOINC (FK)project_id: AUTOINC (FK)

    dt_lastchanged: Alpha(18)

    project_activity_typeproject_id: AUTOINC (FK)activity_type_id: AUTOINC

    activity_name: VARCHAR(40)description: BLOB(1,1)dt_lastchanged: Timestamp project_file

    project_id: AUTOINC (FK)folder_name: VARCHAR(255) (FK)file_name: VARCHAR(255)

    file_exists: BOOLEANdt_lastchanged: Timestamp

    project_statusstatus_id: AUTOINC

    status_name: VARCHAR(40)dt_lastchanged: Timestamp

    application_project_fileapplication_id: AUTOINC (FK)

    project_id: AUTOINC (FK)folder_name: VARCHAR(255) (FK)file_name: VARCHAR(255) (FK)

    dt_lastchanged: Alpha(18)

    Project

    The project table contains the records about the various projects that aremanaged by MTC. Activities recorded by MTC will always be related to a project.Additionally there is a project called non-project that may be used to associateactivities that are not normally related to a project. This default project has aproject_id value of 0 .

    Project

    Field Name Type Constraints Descriptionproject_id Integer Primary key The projects unique identification.

    status_id Integer Foreign key toproject_status(status_id)

    The projects current status. Thestatus names are defined by theproject_status table.

    project_name Varchar(40) None The name of the project. Thisname should be unique, but it isnot required to be so.

    Description Blob(1,1) None A free-form text that describes theproject.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    21/48

    21

    project_start Timestamp None The projects start date.

    project_finish Timestamp None The projects finish date.

    root_folder Varchar(255) None The root folder in the localcomputer which contains all of thedata files relating to the project.

    dt_lastchanged Timestamp None The last time this projects recordwas updated.

    Application

    The application table contains a list of applications that are used by the projects. This table always contains an application record called no application that has anapplication_id value of 0.

    Application

    Field Name Type Constraints Description

    application_id Integer Primary key The applications uniqueidentification.

    executable_file Varchar(255) None The name of the applicationsexecutable file, specified without apath specification. This field shouldbe unique, but it is not required tobe so.

    application_name Varchar(255) None The descriptive name of theapplication. This name should beunique, but it is not required to beso.

    description Blob(1,1) None A free-form text that describes theproject.

    file_exists Boolean None Unused

    dt_lastchanged Timestamp None The last time this applicationsrecord was updated.

    project_application

    The project_application table acts as a many-to-many link between the projecttable and the application table. This table lists which applications are used by

    which projects and vice-versa.

    project_application

    Field Name Type Constraints Description

    application_id Integer Primary key andforeign key to

    Specifies the application involvedin the relation.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    22/48

    22

    application(application_id)

    project_id Integer Primary key andforeign key toproject(project_id)

    Specifies the project involved inthe relation.

    dt_lastchanged Timestamp None The last time this record wasupdated.

    project_status

    The project_status table acts as a lookup table for project status. It defines theallowable values for a projects status.

    project_status

    Field Name Type Constraints DescriptionStatus_id Integer Primary key Uniquely identifies the status

    name.

    Status_name Varchar(40) None The text used to name the status.This field should be unique, but itis not required to be so.

    dt_lastchanged Timestamp None The last time this record wasupdated.

    project_activity_type

    The project_activity_type table defines the activity types available for eachproject. A project has its own types of activities. These activity types are used tocategorize the various activities for MTC. For every project there is always adefault activity type called uncategorized activity . This activity type as anactivity_type_id value of 0.

    project_activity_type

    Field Name Type Constraints Descriptionproject_id Integer Primary key and

    foreign key toproject(project_id)

    Defines the project that thisactivity type belongs to.

    activity_type_id Integer Primary key Uniquely identifies this activitytype.

    activity_name Varchar(40) None The name of the activity. Thisname should be unique, but it isnot required to be so.

    description Blob(1,1) None Free-form text about the activity

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    23/48

    23

    type.

    dt_lastchanged Timestamp None The last time that this activity typewas updated.

    project_activity This table stores the basic unit of activity stored by MTC. Activities arecategorized by an activity type, and are related with a project and an application.

    project_activity

    Field Name Type Constraints Description

    project_id Integer Primary key and foreignkey to project(project_id)

    Defines the project thatthis activity belongs to.

    activity_id Integer Primary key Uniquely identifies theactivity

    activity_type_id Integer Primary key and foreignkey toproject_activity_type(activity_type_id)

    Defines the type of thisactivity.

    application_id Integer Foreign key toapplication(application_id)

    States the currentapplication during thisactivity.

    folder_name Varchar(255) Foreign key toproject_file(folder_name)

    Unused

    file_name Varchar(255) Foreign key toproject_file(file_name)

    Unused

    description Blob(1,1) None Free-form textdescribing the activity.

    activity_start Timestamp None The starting date/time of the activity.

    activity_finish Timestamp None The ending date/time of the activity

    dt_lastchanged Timestamp None Unused

    project_folder

    The project_folder table is only partially used and is present to facilitate furtherdevelopment.

    project_folder

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    24/48

    24

    Field Name Type Constraints Description

    project_id Integer Primary key and foreignkey to project(project_id)

    Defines the project thatthis folder belongs to.

    Folder_name Varchar(255) Primary key The folders name

    Folder_exists Boolean None Unused

    Dt_lastchanged Timestamp None Unused

    project_file

    The project_file table is currently unused and is present to facilitate furtherdevelopment.

    project_fileField Name Type Constraints Description

    project_id Integer Primary key and foreignkey to project(project_id)

    Defines the project thatthis file belongs.

    Folder_name Varchar(255) Primary key and foreignkey to project_folder(folder_name)

    Defines the folder thatthis file belongs.

    File_name Varchar(255) Primary key Unused

    File_exists Boolean None Unused

    Dt_lastchanged timestamp None Unused

    application_project_file

    The application_project_file table is currently unused and is present to facilitatefurther development.

    Application_project_file

    Field Name Type Constraints Description

    Application_id Integer Primary key and foreignkey to application(application_id)

    Defines the applicationthat this file belongs to.

    project_id Integer Primary key and foreignkey to project(project_id)

    Defines the project thatthis folder belongs.

    Folder_name Varchar(255) Primary key and foreignkey to project_folder(folder_name)

    Defines the folder thatthis file belongs.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    25/48

    25

    File_name Varchar(255) Primary key and foreignkey to project_file(file_name)

    Defines the file of theproject file.

    Dt_lastchanged timestamp None Unused

    3.6.2 Template Tables

    This section describes the static template tables. These tables contain static datathat are not normally updated.

    project_template_activity_typeactivity_type_id: AUTOINCtemplate_id: INTEGER (FK)

    activity_name: VARCHAR(40)

    project_templatetemplate_id: AUTOINC

    template_name: VARCHAR(20)

    project_template_folder folder_id: AUTOINCtemplate_id: INTEGER (FK)

    folder_name: VARCHAR(255)

    The project templates define the initial settings for a newly created project. Therefore, when new projects are created, several aspects of the project arealready configured.

    Project_template

    The project_template is the master table that stores the pre-defined projectsettings ( project templates ). Data contained in this and its detail tables are notmeant to be updated.

    Project_template

    Field Name Type Constraints Description

    project_template_id Integer Primary key Uniquely identifies the projecttemplate.

    template_name Varchar(255) none The displayed name of theproject template. This nameshould be unique.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    26/48

    26

    Project_template_folder

    The project_template_folder table defines the folder names of a project template.When a new project is created, the folders are auto-created based on the projecttemplate.

    project_template_folder

    Field Name Type Constraints Description

    project_template_id Integer Primary key and foreignkey to project_template(project_template_id)

    Defines whichproject templatethat this folder belongs.

    folder_id Integer Primary key Uniquelyidentifies theproject templatefolder.

    folder_name Varchar(255) None Defines thefolders name.This field shouldbe unique.Subfolders arespecified using arelative pathname.

    Project_template_activity_type The project_template_activity_type defines the initial activity types for a newproject. For each project template, there is always an activity type calleduncategorized activity that has an activity_type_id value of 0.

    project_template_folder

    Field Name Type Constraints Description

    project_template_id Integer Primary key and foreignkey to project_template(project_template_id)

    Defines whichproject templatethat this activitybelongs.

    activity_type_id Integer Primary key Uniquelyidentifies theactivity type.

    activity_name Varchar(255) None The activityname. This fieldshould be unique.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    27/48

    27

    3.7 Behavioral Model and Description

    This section describes the events responded by MTC and its internal statemachine. These events are the primary inputs of the business logic layer, whilethe state machine comprises the majority of the layer.

    3.7.1 Application Events

    This section lists the application-defined events of MTC. These events are theprimary triggers of the activity monitor state machine transitions.

    Application Switch

    This event is raised when the user switches to another application. It is obtainedby the agent from the CBT hook chain and then relayed to the client.

    Idle User

    This event is raised when the user is idle. It is inferred when the keyboard andmouse has not been used for a prolonged amount of time. Keyboard and mouseactivities are sent by the agent, and then the client will decide whether asignificant amount of inactivity has occurred.

    Power Change

    This event is raised when the computer is entering suspend or hibernate mode. Itis obtained from a window message -- WM_POWER-- that is broadcasted to all top-level windows upon power state changes.

    Hide Popup

    This event is raised when the popup window TFrmActivityPopup has beendismissed by the user. The window reports this event to the activity monitor.

    File Write

    This event is raised when a file located within the current projects directory (orits subdirectories) is written. File writes are detected by the TDirectoryMonitorcomponent, and notified to the activity monitor via the main form.

    3.7.2 State-Transition Diagram

    This section provides the state-transition diagram of the activity monitor. It is

    implemented in the ActivityContext class as an extended state machine. In orderfor the diagram to be comprehensible, it only depicts the significant statetransitions of the machine.

  • 8/14/2019 Meeting Thinking and Coding - Internship Report

    28/48

    28

    Monitoring1

    (A) RecordcurrentApplication

    (B) notecurrentApplication

    Monitoring2

    (C) displayapplication popup

    (D) record applicationusage activity

    Monitoring3

    (E) Record last activitybefore going idle

    Monitoring Idle time(popup di splayed)

    (F) recordidle time

    The last knowncurrentApplication isautomatically recordedas an activity

    The popup dialog

    displays the last knowncurrentApplicationapplicationswitch no application

    switch for tpLongApp

    seconds

    user is idle

    application switch

    no applicationswitch for

    tpShortAppseconds

    tpPeriodicPopup elapsed

    application switch

    user is idle

    answer popup dialog

    user is idle

    MTC Startup

    popup dialoganswered

    There are three time parameters involved in the state machine: tpShortApp ,tpLongApp , and tpPeriodicPopup . These parameters are configured at run-time, andmust consist of increasing values in the order listed. That is, tpShortApp