Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Application design

    How do most of you construct your applications?

    Do you break it up into sections based on the functions of the app?

    example:

    contact_add.php
    contact_delete.php
    contact_edit.php
    .....

    Do you write one long script, and then call parts of it using a variable?

    example:

    contact.php?action=add

    Or do you do something else, like use a MVC design pattern? I'm interested
    in rethinking the way I write stuff. Any suggestions would be helpful.

    Thanks




    Jason Guest

  2. Similar Questions and Discussions

    1. Application High Level Design
      I am building a registration form in Flex that could have up to 120 fields for the user to fill out depending upon what they select. They may not...
    2. Inviting suggestions for client application design
      Hi, We want to develop a client application that can be plugged into hundreds of other applications used by our bank. These applications include...
    3. Books on Web application architecture and design with samples
      This question is more than totally unrelated to this forum, but I'll try a suggestion... visit www.google.com and search on "book on architecture...
    4. Network application design question
      I need a little help getting started in the right direction: I'm developing an application that has a server side and a client side. It's...
    5. OT: Database Design for New Application LOVE MATCH!
      Hi there. I'm writing to get support/advice/comments on a new web site I am about to create. It is going to be a sort of Love Connection type...
  3. #2

    Default Re: Application design

    In article <NZW8b.18342$kX.1326@twister.tampabay.rr.com>,
    "Jason" <jsumner1@cfl.rr.com> wrote:
    > How do most of you construct your applications?
    >
    > Do you break it up into sections based on the functions of the app?
    >
    > example:
    >
    > contact_add.php
    > contact_delete.php
    > contact_edit.php
    I prefer to do it like that, including shared code at the top of each
    section, like this:

    include('contact_defs.inc.php');
    include('contact_functions.inc.php');
    > Do you write one long script, and then call parts of it using a variable?
    >
    > example:
    >
    > contact.php?action=add
    I'd rather not do it like that. The 'one long script' has a tendency to
    become spaghetti code with way too many 'if ... elseif ....' sections in
    it pretty quick.

    Also, to keep my scripts clean, concise and 'to the point', I usually
    offload all HTML production to Smarty. (see [url]http://smarty.php.net/[/url]).

    JP

    --
    Sorry, <devnull@cauce.org> is een "spam trap".
    E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
    Jan Pieter Kunst Guest

  4. #3

    Default Re: Application design

    On Sun, 14 Sep 2003 09:59:09 GMT, "Jason" <jsumner1@cfl.rr.com> scrawled:
    >How do most of you construct your applications?
    >
    >Do you break it up into sections based on the functions of the app?
    >
    >example:
    >
    >contact_add.php
    >contact_delete.php
    >contact_edit.php
    >....
    >
    Many draw backs to this - mainly with duplicating large amounts of user
    code (security at the top) of each script, and having to jump through
    hoops to correctly handle "fall-back" scenarios.
    >Do you write one long script, and then call parts of it using a variable?
    >
    >example:
    >
    >contact.php?action=add
    I tend to do it this way... but create an action class...

    with methods such as ACTION_add, ACTION_delete, ACTION_edit...

    The I have code which collections the action from the URL, checks to see
    if the ACTION_{$action} method exists - and if so calls it...

    This method has many advantages over the single script... you end up not
    duplicating many of the "fall-back" actions many times...

    It is much easier to add user level security at this sort of level.. (in
    fact it becomes easy to set up configurable security levels)

    AND you don't end up with the "spaghetti" code

    My "class" heirachy often ends up as:

    "application".inc
    |
    | (isa)
    |
    core.inc (central functions
    |
    | (isa)
    |
    site.inc (general templating code)
    |
    | (hasa)
    |
    dbhandle.inc (database interface code - like perl's DBI)
    >Or do you do something else, like use a MVC design pattern? I'm interested
    >in rethinking the way I write stuff. Any suggestions would be helpful.

    James Guest

  5. #4

    Default Re: Application design

    Very useful! Thanks

    "James" <newsgroup@black-panther.freeserve.co.uk> wrote in message
    news:3f645344.67911992@news.freeserve.com...
    > On Sun, 14 Sep 2003 09:59:09 GMT, "Jason" <jsumner1@cfl.rr.com> scrawled:
    >
    > >How do most of you construct your applications?
    > >
    > >Do you break it up into sections based on the functions of the app?
    > >
    > >example:
    > >
    > >contact_add.php
    > >contact_delete.php
    > >contact_edit.php
    > >....
    > >
    >
    > Many draw backs to this - mainly with duplicating large amounts of user
    > code (security at the top) of each script, and having to jump through
    > hoops to correctly handle "fall-back" scenarios.
    >
    > >Do you write one long script, and then call parts of it using a variable?
    > >
    > >example:
    > >
    > >contact.php?action=add
    >
    > I tend to do it this way... but create an action class...
    >
    > with methods such as ACTION_add, ACTION_delete, ACTION_edit...
    >
    > The I have code which collections the action from the URL, checks to see
    > if the ACTION_{$action} method exists - and if so calls it...
    >
    > This method has many advantages over the single script... you end up not
    > duplicating many of the "fall-back" actions many times...
    >
    > It is much easier to add user level security at this sort of level.. (in
    > fact it becomes easy to set up configurable security levels)
    >
    > AND you don't end up with the "spaghetti" code
    >
    > My "class" heirachy often ends up as:
    >
    > "application".inc
    > |
    > | (isa)
    > |
    > core.inc (central functions
    > |
    > | (isa)
    > |
    > site.inc (general templating code)
    > |
    > | (hasa)
    > |
    > dbhandle.inc (database interface code - like perl's DBI)
    > >Or do you do something else, like use a MVC design pattern? I'm
    interested
    > >in rethinking the way I write stuff. Any suggestions would be helpful.
    >
    >
    >

    Jason Guest

  6. #5

    Default Re: Application design

    "Jan Pieter Kunst" <devnull@cauce.org> wrote in message
    news:devnull-95418B.12534414092003@news1.news.xs4all.nl...
    > In article <NZW8b.18342$kX.1326@twister.tampabay.rr.com>,
    > "Jason" <jsumner1@cfl.rr.com> wrote:
    >
    > > How do most of you construct your applications?
    > >
    > > Do you break it up into sections based on the functions of the app?
    > >
    > > example:
    > >
    > > contact_add.php
    > > contact_delete.php
    > > contact_edit.php
    >
    > I prefer to do it like that, including shared code at the top of each
    > section, like this:
    >
    > include('contact_defs.inc.php');
    > include('contact_functions.inc.php');
    >
    > > Do you write one long script, and then call parts of it using a
    variable?
    > >
    > > example:
    > >
    > > contact.php?action=add
    >
    > I'd rather not do it like that. The 'one long script' has a tendency to
    > become spaghetti code with way too many 'if ... elseif ....' sections in
    > it pretty quick.
    >
    > Also, to keep my scripts clean, concise and 'to the point', I usually
    > offload all HTML production to Smarty. (see [url]http://smarty.php.net/[/url]).
    >
    > JP
    >
    > --
    > Sorry, <devnull@cauce.org> is een "spam trap".
    > E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
    >
    I break mine up too....but I use patTemplate instead of Smarty :)


    Jason Guest

  7. #6

    Default Re: Application design

    "Jason" <jsumner1@cfl.rr.com> wrote in message
    news:NZW8b.18342$kX.1326@twister.tampabay.rr.com.. .
    > How do most of you construct your applications?
    > Or do you do something else, like use a MVC design pattern? I'm interested
    > in rethinking the way I write stuff. Any suggestions would be helpful.
    here is one possible approach with combination of templates and MVC

    [url]http://www.templatetamer.org/index.php?ModelViewControllerPattern[/url]

    rush
    --
    [url]http://www.templatetamer.com/[/url]



    rush Guest

  8. #7

    Default Re: Application design

    "Jason" <jsumner1@cfl.rr.com> wrote in message news:<NZW8b.18342$kX.1326@twister.tampabay.rr.com> ...
    > How do most of you construct your applications?
    >
    > Do you break it up into sections based on the functions of the app?
    >
    > example:
    >
    > contact_add.php
    > contact_delete.php
    > contact_edit.php
    > ....
    >
    > Do you write one long script, and then call parts of it using a variable?
    >
    > example:
    >
    > contact.php?action=add
    >
    > Or do you do something else, like use a MVC design pattern? I'm interested
    > in rethinking the way I write stuff. Any suggestions would be helpful.
    >
    > Thanks
    I have very small scripts that perform a single function each, as in
    your first example, as I find smaller scripts a lot easier to
    maintain. I also use the 3 tier architecture which means that all my
    business logic for each entity is maintained in a single class which
    can then be shared by any number of scripts in the presentation layer.

    All my HTML is generated from XML data files which are then
    transformed using XSL stylesheets. I have found that I can place a lot
    of my XSL code in small files which I can reuse by using the
    <xsl:include> command.

    For an overview of my environment check out
    [url]http://www.tonymarston.net/php-mysql/infrastructure.html[/url]

    Tony Marston
    http:/www.tonymarston.net/
    Tony Marston Guest

  9. #8

    Default Application design

    Hi I will be passing around an #id# (lodging) between a local database query
    and a web service. Descriptive data resides in a database with the #id#, then
    additional data is then requested using a webservice with the same #id# as in
    the database. It is always a db query first, then webservice second. There are
    100,000 records, and the web clients will not be members or have any ID of
    their own while browsing and changing the #id# if they wish to do so. Question
    is do I created a #session.id# per client query, and do I use cookies to keep
    the user requests in sync with that #id# as many clients may be using the
    website at the same time. Thanks

    DuLaus Guest

  10. #9

    Default Re: Application design

    bump
    DuLaus Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139