Login   Register  
PHP Classes
elePHPant
Icontem

Creating an Appointment Calendar - Part 01 - Appointment Calendar package blog

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  All package blogs All package blogs   Appointment Calendar Appointment Calendar   Blog Appointment Calendar package blog   RSS 1.0 feed RSS 2.0 feed   Blog Creating an Appointme...  
  Post a comment Post a comment   See comments See comments (1)   Trackbacks (0)  
>> Next: Creating an Appointme...

Author: Michael J. Fuhrman

Posted on:

Package: Appointment Calendar

This blog series demonstrates how to use Ladder to create an Appointment Calendar. Its goal is to provide readers with a clear understanding of how to build a simple application using reusable components based on Ladder’s data management capabilities. Future articles will rely on these concepts to build larger applications.






1. Overall Scope:
=================

This blog series demonstrates how to use Ladder to create an Appointment Calendar. Its goal is to provide readers with a clear understanding of how to build a simple application using reusable components based on Ladder’s data management capabilities. Future articles will rely on these concepts to build larger applications.

The Appointment Calendar demo will extend two classes of Ladder: the Item and the Folder data class. The Item class is used to manage the Appointment Information and is akin to a row in a SQL table. The Folder class will manage where all the appointments are stored in the Ladder tree, and is akin to a SQL table .

At the completion of this article, the reader should have a functional appointment calendar and an understanding of how to use Ladder .

Covered in this series:
=======================
1. Overall Scope
2. Reader Requirements
3. How Ladder Works
4. Appointment Calendar Requirements
5. Appointment Calendar Design Guides
6. Appointment Data Class Design
7. Create the class install script
8. Create an Appointments Folder in Ladder.
9. Create the Appointment data classes
10. Designing the Appointments Presentation
11. Implementing the Appointment Presentation
12. List Appointments by Date
13. Directory Layout
14. Review & Follow up.
15. FAQs

2. Reader Requirements
=======================

Readers of this blog should be familiar PHP, extending objects, including files, directory structures, SQL, PHP, and JavaScript.

This demonstration requires:
- PHP 4.5 or higher
- Ladder for PHP
- Apache or IIS web server
- mySQL 5.0 or higher

Ladder for PHP was specifically designed for mySQL. Ladder for PHP will work with other SQL servers ; however it will require changes to the install scripts. Each SQL's server's method of creating tables and indexes is unique.

Note: This post is written for PHP 4.5, abstraction was not introduced until version 5.0.

Note: It is recommended that Ladder be installed into a separate database partition so that tables it creates do not conflict with existing or future tables.

3. How Ladder Works
=================

Ladder resides at the bottom of the Business Logic Layer and above the Data Layers. This area is known as known as the Data Management Interface. This interface marries the Data Classes in the Business Logic Layer with the SQL server tables. This interface controls the storage, retrieval and relationships of objects. Most applications usually build a custom set of classes for every application, and when the application changes, so does this layer.

Ladder abstracts the Data Management Interface, providing a consistent set of classes to manage the storage, retrieval and relationships of data. It does this by classifying data based on three basic data types: [ Folder | Item | Reference ]. This provides programmers two powerful tools: 1) Business Logic object models can be represented directly into the store. 2) Data stored in Ladder acts exactly like the directory folder structure of a hard drive.

Folders can contain any data type. Item data types only contain properties - field values. Reference data types point to Folders. These three data types create a hierarchy which gives Ladder its name and work like a file structure. The hierarchy is used to organize complex data relationships while separat ing the data from the relationship.

What this means to programmers is that less time is required to build and debug data relationships when Ladder is used. And what this means to designers is that less time is required to design and test an application where the Data Layer uses the same model as the Business Logic Layer.

4. Appointment Calendar Requirements:
==================================

The first part of application development is to identify the requirements for the application. The Appointment Calendar has a few general requirements:

- Appointments are listed by day
- The List can be refreshed by the user
- The List is refreshed every time an appointment is Added, Deleted, or Moved
- Appointments are added in a separate page
- Appointments are edited in a separate page
- Appointments can be viewed in a separate page
- Appointments do not need to repeat

The requirements for the Appointment Calendar application set the stage for the Design and Implementation of the appointment calendar.

5. Appointment Calendar Design Guides:
=======================================

In Application Programming, there are three layers: Presentation, Business Logic, and the Data Layer. By outlining how these layers could look, the designer can guild the implementation of the application , and determine whether the implementation will meet the requirements and fit in the overall scope of larger projects.

- The Presentation layer focuses on everything needed to manage the user's experience (CSS, HTML, JavaScript).

- The Business Logic layer focuses on managing the data in memory. (PHP, ASP, Java, C#, .Net, VB, ...)

- The Data Layer focuses on all the data placed in secondary storage – ie a SQL server. (SQL)

The design of the Appointment Calendar will be done based on general requirements for an appointment. Also known as design patterns.

Presentation Layer:
- Display a simple calendar for the week, and allow options to navigate between Previous / Next week, month and year, as well as return to the current date.
- Provide a consistent set of navigation links for the calendar
- Provide a consistent view for displaying the calendar entries in the list, new, edit and view pages.
- Moving an appointment to a different date should seem obvious
- Components of the presentation should be reusable and follow a consistent design format.

Business Layer:
- The object model for an appointment will consist of the following fields: Date Target, Appointment Start Time, Appointment Length and Memo field.

Data Layer:
- This will be managed by Ladder. Therefore no work here is needed at this time.

The designing the Appointment Calendar application is very simple. It requires a calendar, a list of appointments by day, and the ability to create, delete, view, update and move appointments . At this time, it appears that most of the work will be performed in the presentation layer to manage the user experience.

The next step will be to design the Data Class for the Appointment Calendar.

6. Appointment Data Classes Design:
=======================================

While there are several types of appointments and fields that can be used to capture their data, the most common type of appointment only repeats once. And the requirements for this project request that appointments do not repeat .
Based on the design documentation, the appointment needs to capture the date of the appointment, the time that the appointment begins and ends, and a message about what the appointment is about.

The Appointment Item Data Class will need the following fields:

01.. dTarget DATETIME
02.. nTime INTEGER
03.. nLength INTEGER
04.. szMemo STRING

Line 1 .. captures the date the appointment is to occur.

Line 2 .. captures the time that the appointment is to occur on that date.

Line 3 .. captures the length of the appointment. The increments of the appointment length can vary, usually most people don't have less than 30 minute appointments. However if needed, 15 minute increments have been seen.

Line 4 .. captures the content of the appointment, ie .. what is happening at this time.

This design information will be used later when we construct the class description for Ladder, and design the PHP Classes for these data classes.

Wrap Up
======================================
This blog post covered some basic concepts on how and where Ladder works within an application. It developed simple requirements and design guides for an Appointment Calendar project. And it designed the data model that would be used to contain the Appointment data.

Next Post
======================================

The next post will describe how to extend the ldrFolder and ldrItem classes so that PHP classes for Common_Appointment and Common_Appointments can be created.

/* =======================================
Copyright 1998 - 2010 - E Net Arch
This program is distributed under the terms of the GNU
General Public License (or the Lesser GPL).
======================================= */


You need to be a registered user or login to post a comment

Login Immediately with your account on:

Facebook ConnectGmail or other Google Account
Hotmail or Microsoft Windows LiveStackOverflow
GitHubYahoo


Comments:

1. aa - Azer (2014-04-13 06:42)
sfssds... - 0 replies
Read the whole comment and replies


>> Next: Creating an Appointme...


  Post a comment Post a comment   See comments See comments (1)   Trackbacks (0)  
  All package blogs All package blogs   Appointment Calendar Appointment Calendar   Blog Appointment Calendar package blog   RSS 1.0 feed RSS 2.0 feed   Blog Creating an Appointme...