Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have an application where I have the \'core\' code in one folder for which the

ID: 651150 • Letter: I

Question

I have an application where I have the 'core' code in one folder for which there is a virtual directory in the root, such that I can include any core files using /myApp/core/bla.asp. I then have two folders outside of this with a default.asp which currently use the querystring to define what page should be displayed. One page is for general users, the other will only be accessible to users who have permission to manage users / usergroups / permissions. The core code checks the querystring and then checks the permissions for that user. An example of this as it is now is default.asp?action=view&viewtype=list&objectid=server. I am not worried about SEO as this is an internal app and uses Windows Auth.

My question is, is it better the way it is now or would it be better to have something like the following:

/server/view/list/
/server/view/?id=123
/server/create/
/server/edit/?id=123
/server/remove/?id=123
In the above folders I would have a home page which defines all the variables which are currently determined by the querystring - in /server/create/ for example, I would define the action as 'create', object name as 'server' and so on.

In terms of future development, I really have no idea which method would be best. I think the 2nd method would be best in terms of following what page does what but this is such a huge change to make at this stage that I would really like some opinions, preferably based on experience.

PS Sorry if the tags are wrong - I am new to this forum and thought this was a bit too much of a discussion for StackOverflow as that is very much right / wrong answer based. I got the idea SE is more discussion based.

Explanation / Answer

The best way is to split it up. This will make it much easier to maintain because there are only small chunks that you need to deal with at any one time.

What you need to do is to first create a framework which will be used universally across all the pages/functions. This will have common bits in it like access control, menus, validation scripts, styles, etc

Then are there any objects that could be shared across pages? Things like business objects, data access layers, report generation, drop downs, etc. Put these into separate classes/files/etc. If you need to code it more than once, it should be in a library type file and included where required.

Now build pages for each discrete action, and group them by functionality or by permissions into separate folders.

Remember that a query string is an easy way for a user to enter in false data - does the application require a level of robustness? Best way is to use a session type object for passing information between pages for a security and integrity point of view.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote