Showing posts with label bestpractice. Show all posts
Showing posts with label bestpractice. Show all posts

2008-07-08

Tagging best practices

Tagging (folksonomy) is a popular and powerful way of organizing stuff on the web. But as your tagbase grows, it itself needs to get organized...
  1. lowercase (use google, css, zend framework instead Google, CSS, Zend Framework, even with names)
  2. english (describe the object in english words, transcribe all non-english characters and punctuation to alphanumeric characters [a-z0-9], tags like 2006, 90s are ok)
  3. simple (don't use multi-word tags unless it's a name or a well established phrase)
  4. singular (use map, monkey, video instead maps, monkeys, videos)
  5. noun (use drawing, meditation, design instead draw, meditate, designed)
  6. system (build a personal framework, a set of tags based on your areas of interest, level of abstraction, word preference, etc. and stick to it. Ask yourself what's the most appropriate set of tags for your purpose. Remember, whatever object you are tagging, there are possibly millions of tags applicable. Pick only the tags that fit your paradigm)
  7. balance (when tagging an item, choose the most relevant tags from your set. If you are tagging article, ask what is it about, not what's mentioned in it. If you create too few or too many relations, your system becomes ineffective)
  8. action tags (one thing that works for me are action tags like 2check, 2read, 2explore, 2print...)
  9. consistency (whatever rules you pick, stick to them)
  10. reuse (try to reuse words you have already in your tag base before adding new word. Avoid having multiple synonyms with same meaning)
If you are not sure what tags to use, ask yourself "What keywords would I enter into search engine when searching for item like this?".

2007-12-15

Bootstrapping PHP application

What?

Bootstrapper is a single access point (index.php script located in the web's document root) of the web application. Its purpose is to handle all incoming requests by 1. setting up the application environment, 2. routing the request to the correct action controller and 3. dispatching it.

Why?

Easy application configuration (all that is common is in single bootstrapper file).

How?

Setting up the application environment
  1. set up php environment if necessary (error reporting, include paths,...)
  2. set up class loader (and register is as autoloader within php)
  3. load common classes
  4. load configuration into registry
  5. setup db and store db handle into registry
  6. set up caching
  7. set up front controller
  8. set up router
  9. dispatch front controller
Routing the request to the action controller
  1. set up router
Dispatching the request (dispatch loop)
  1. dispatch front controller

Links