For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2004 > backend/admin area design question - one big switch() or break it down into separate









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author backend/admin area design question - one big switch() or break it down into separate
asdf

2004-03-26, 11:12 pm

So I need to track/manage news articles, users and links, quotes, etc. I
see that some people like this style, where you have one big switch
statemment:

switch($section)
{
case 'news':
# ... ... ...

break;
case 'links':
# ... ... ...

break;
case 'users':
# ... ... ...
break;

So then you can make a bunch of function calls etc. Now I can see why
you'd like this, because it's more C-like or C-oriented style.

But what about this:
/admin/news/list.php
/admin/news/edit.php
/admin/links/edit.php
/admin/links/edit.php

.... but to me that seems more intuitive from a web page perspective -
any thoughts on this?




Craig Keightley

2004-03-26, 11:12 pm

The alter of the two options is what I usually go for, mainly because of the
freedom in designing a look to the pages.
Certain products/news articles may differ in content in terms of fields to
complete. Plus the way in which we work here using dynamic editable text
instead of forms makes it easier to layout and code
hth
Craig
"asdf" <asdf@news.sf.sbcglobal.net> wrote in message
news:MPG.1ac8308ea08d88d5989680@news.sf.sbcglobal.net...
> So I need to track/manage news articles, users and links, quotes, etc. I
> see that some people like this style, where you have one big switch
> statemment:
>
> switch($section)
> {
> case 'news':
> # ... ... ...
>
> break;
> case 'links':
> # ... ... ...
>
> break;
> case 'users':
> # ... ... ...
> break;
>
> So then you can make a bunch of function calls etc. Now I can see why
> you'd like this, because it's more C-like or C-oriented style.
>
> But what about this:
> /admin/news/list.php
> /admin/news/edit.php
> /admin/links/edit.php
> /admin/links/edit.php
>
> ... but to me that seems more intuitive from a web page perspective -
> any thoughts on this?
>
>
>
>



Steve Addison

2004-03-26, 11:12 pm


"asdf" <asdf@news.sf.sbcglobal.net> wrote in message
news:MPG.1ac8308ea08d88d5989680@news.sf.sbcglobal.net...
> So I need to track/manage news articles, users and links, quotes, etc. I
> see that some people like this style, where you have one big switch
> statemment:
>
> switch($section)
> {
> case 'news':
> # ... ... ...
>
> break;
> case 'links':
> # ... ... ...
>
> break;
> case 'users':
> # ... ... ...
> break;
>
> So then you can make a bunch of function calls etc. Now I can see why
> you'd like this, because it's more C-like or C-oriented style.
>
> But what about this:
> /admin/news/list.php
> /admin/news/edit.php
> /admin/links/edit.php
> /admin/links/edit.php
>
> ... but to me that seems more intuitive from a web page perspective -
> any thoughts on this?
>
>
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com