[cgiapp] looking for concepts: code reuse

Alex capfan at gmx.de
Tue Sep 15 09:39:59 EDT 2009


Dear all!

Lately, I encounter quite a lot of applications where I have to pic one of
many records to do something with it. E.g. there is a user manager, that
displays a list of all users, and a button that leads to a function, such as
edit or delete user.
This list of users is is shown somewhere else, e.g. in the billing part of
the software, where I have to pick a user out of a list, for which I have to
record his entries.

The common part is, that there is a list displayed, that contains all users,
and that has some specific buttons. ATM, I recode the same thing over and
over again (fetching the list of users, filling a template), mainly because
there are different templates to be used.

Now, there is this prerequisite that I put all stuff of a part of an
application in its own namespace, according to a tutorial fom the CA
website. I like that idea, as I can reuse big parts of functionality in
other applications with only a small effort.

So isn't there a better way? A more general / generic way? Should such thing
be coded as a more generic plugin? Is there a good reason not to change it?
Or is it useful to recode the same functionality for each part of the
application to reduce complexity and allow a higher level of customization?

I'm not sure about this. For now, I just will keep on recoding another user
selection for another functionality.

If any questions, feel free to ask. It's possible, that the information
above is too spare.

Regards, Alex



More information about the cgiapp mailing list