Be careful about username case sensitivity!! Home : list of blogs filtered by a category or time range, with paging ViewBlog : read a single blog with all comments and a comment input form NewBlog : create a new blog, with file attachment form and THtmlArea EditBlog : edit an existing blog LoginUser : login page NewUser : create a new user EditUser : edit the current user Admin : whether allow multiple users, whether HTML is allowed (first user is always the admin) URL design: index.php?page=ListBlog×pan=123,456&limit=123,456 : list of latest blogs, equivalent to: index.php?page=NewBlog index.php?page=EditBlog&id=123 index.php?page=ViewBlog&id=123 index.php?page=NewUser index.php?page=EditUser index.php?page=ViewUser index.php?page=Admin Use Case 1: Add a post 1. Authorization check 2. display UI for adding post 3. input validation 4. add post to DB 5. display UI for post list DB Logic needed: class Post extends DataObject { public $xxx; } class Comment extends DataObject { } class UserProfile extends DataObject { } class DataObject extends TComponent { protected static $mapping=array(); public function __construct($db) { } protected static function generateModifier($filter,$orderBy,$limit) { $modifier=''; if($filter!=='') $modifier=' WHERE '.$filter; if($orderBy!=='') $modifier.=' ORDER BY '.$orderBy; if($limit!=='') $modifier.=' LIMIT '.$limit; return $modifier; } public static function queryRow($filter='') { $modifier=self::generateModifier($filter,'',''); } public static function query($filter='',$orderBy='',$limit='') { $modifier=self::generateModifier($filter,$orderBy,$limit); } public function save() { } public function delete() { } } public function queryUsers($filter='',$sortBy='',$limit='') public function queryUser($id) public function insertUser($user) public function updateUser($user) public function deleteUser($id) public function queryPosts($filter='',$sortBy='',$limit='') public function queryPost($id) public function insertPost($post) public function updatePost($post) public function deletePost($id) public function queryComments($filter='',$sortBy='',$limit='') public function queryComment($id) public function insertComment($comment) public function updateComment($comment) public function deleteComment($id)