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 1036197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:39:52+00:00 2026-05-16T14:39:52+00:00

Ok, it’s my fault. I’ve never ever learned programming at a school and that’s

  • 0

Ok, it’s my fault. I’ve never ever learned programming at a school and that’s why i’m always ending up in a spaghetti code. I’ve always curious about different patterns and tried to understand them at least in a basic level.

MVC is my worst fear and i think i’ll be never able to use it’s advantages because of i don’t understand it’s fundamentals.

My actual question/problem looks like:

The front controller calls a ‘Core’ class which is doing some initialization then it calls the actual controller with the correct action/parameters. The controllers always extending the ‘Core’ class so i can acces it’s variables, etc. They’re working nicely together but here comes my real problem.

Some kind of methods (getting a database entry in most of the cases) are required in different cases. (e.g. a product needs it’s manufacturer)

In this scenario i have two (bad) choices:

  • Inject the required method into the ‘Core’ class so it’s getting bloated over time
  • Inject the required method into the actually called controller so i will end up a redundant codebase

I see a lot of possible problems in my approach:

  • Controllers are always extending ‘Core’ class
  • ‘Core’ controller holds the database object so without it i cannot access my Db
  • Database functions (e.g. getting a product) are in the controllers but i cannot access them because they’re always calling ‘Core’ first (extending problem again)

Please tell me:

Where is the biggest problem in my approach and where can i correct it?

Note:

Please don’t treat this as a general question, i think this is an answerable thing. If you need some clarification, please ask for it and i’ll try to lighten up things.

Thanks for your precious time, fabrik

  • 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-05-16T14:39:53+00:00Added an answer on May 16, 2026 at 2:39 pm

    Your biggest problem is having the “Core” class, get rid of it asap.
    By the way, the FrontController is not the only way to do things MVC things either.

    Your second problem is that controller deals with database, it shouldn’t. I suggest you use some abstract data layer, which you use only in your models. And controller should deal only with models, it shouldn’t care how models get their data persisted and fetched.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I know there's a lot of other questions out there that deal with this
I don't have much knowledge about the IPv6 protocol, so sorry if the question

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.