Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8899625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:54:10+00:00 2026-06-15T00:54:10+00:00

Brief Explanation I am unsure about the structure that I have used for this

  • 0

Brief Explanation

I am unsure about the structure that I have used for this group of websites. I have tried to share as much code throughout these websites as possible in order to minimise duplicate code and improve efficiency. However, I am not sure whether it is good OOP and would therefore like to hear some other views about it and whether or not I should change the structure.

Consider these websites:

www.domain.com
support.domain.com
clients.domain.com
export.domain.com
etc

I started by creating a class called class.domain.php. This class contains all of the global methods for the Web Application.

Then for each subdomain I created a sub class such as class.www.php, class.support.php etc.

If there are any large sectors of these subdomains then I create further subclasses to reduce the size of the parent class.

So effectively I have ended up with a family tree of classes like so:

Class Relational Tree

Each class contains methods that are relevant to that particular site/section. The methods include things such as:

  1. Gathering dynamic data and returning it to the page
  2. Processing forms and sending emails (contact, support requests etc).
  3. Security Token system
  4. Login System
  5. etc

My Questions

Not only do I want to know whether this structure is good, I also would like to know whether or not I should be using OOP for things such as processing ‘contact’ forms etc.

It just seems a bit extravagant (and hard to maintain) if I have individual methods for each form. The forms are too unique to be managed by one global method so they either have to be processed using a unique method for each form, or by having a script for each form that has nothing do do with the class (would be easier to maintain).

To summarize:

  1. Is this structure an effective and good OOP structure?
  2. Should I be processing my forms with individual methods within the classes or should I be writing individual scripts for each of the forms?

Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:54:11+00:00Added an answer on June 15, 2026 at 12:54 am

    Seems fine to me.

    You can make things a bit more abstract maybe by implementing an interface or some abstract functions for the formprocess e.g.

    You can write a BaseForm and all childs of BaseForm need to implement “validate()”, “process()”. That given you can always be certain that your classes implement those methods. So that you can use it in your action like

    $form->validate($post_data);
    if($form->isValid()){
      $form->process();
    } else {
      $form->handleError();
    }
    

    since you have the possibility to write OOP, i suggest you to it since its also a lot easier to maintain it.

    I still have to fiddle arround with older projects (like osCommerce) at my work and could scream when i see all the code duplications and if a single file contains about 3000-4000 lines of code with if-clauses spanning for a thousand lines you can very hard maintain it.
    So for your own sake: stick to oop

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Brief Idea about the flow : I have say minimum 1 and maximum 18
Brief intro about my requirement. I have an empty JSF dataTable. Now, when I
The example will give a brief explanation of what i'm talking about: AFTER INSERT,UPDATE
I've run into a bit of an issue. Here's a brief explanation. I have
I was reading a book on servlets, in that book a brief explanation is
A Brief Explanation This is not as basic as it sounds, so please do
could someone give me a brief explanation of what is happening differently in the
Brief backstory, our previous developer used ASIHTTPRequest to make POST requests and retrieve data
In brief: What is the pattern called in the following code, and how should
I need a brief explanation on how the two commands isdigit() and isalpha() work.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.