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

  • Home
  • SEARCH
  • 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 8163019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:55:26+00:00 2026-06-06T18:55:26+00:00

my query is about architecture and relation of classes, I would like to know

  • 0

my query is about architecture and relation of classes, I would like to know better solution than I have implemented.

I have 4 classes , explaining one line for each

  1. core.php class which will have all common functions
  2. A.php class file which contains specific function for task A like writing on csv file A.
  3. B.php class file which contains specific function for task B like writing another csv file which is totally different from csv A.
  4. X.php class which is another task specific class.

Now come to general script which will use all 4 classes. so I am not understanding which class will extend which another class

No relation between A.php and B.php

But x.php must use all 3 classes core.php, A.php and B.php.

currently what I have done , I design one interface for core class, and x.php extend core class and implement interface. I design A.php and B.php as static classes.

Please guide

  • 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-06T18:55:27+00:00Added an answer on June 6, 2026 at 6:55 pm

    You don’t have to extend classes if they have nothing to do with each other. You can simply use one class inside another without those two having any relationship inheritance or interface-wise.

    You may structure it like this:

    • class Common is your base class that every class inherits from and contains common code that all classes need, say code for logging or database access.
    • class A extends Common and is specialized for some CSV-related tasks. This class may or may not actually do anything by itself.
    • class B extends A and is even more specialized to some specific task involving CSV.
    • class X extends Common and is again some other task.

    Generally, if a class does almost the same but slightly more specialized or differently, extend a common base class. If a class has nothing at all in common with another, just make them standalone classes. Use interfaces for polymorphism; it doesn’t sound like that’s what you need right now.

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

Sidebar

Related Questions

HI, I have this query about smart pointers. I heard from one of my
How would I go about running a query in asp and storing it in
How would I go about doing a query that returns results of all rows
I'm thinking about the problem in question title: if I have to query for
I have a query about type of null. I have a small program can
just a quick query about safe/unsafe states in Dijkstra's Banker's algorithm ... If one
I have this SQL query about getting the 5 events today: SELECT n.nid, n.type,
We have a huge pattern match in a query (about 12 strings to check).
I have a question about database architecture. We are building a CMS. There are
I have some query about my code, I am using VB6.0 and I have

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.