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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:03:28+00:00 2026-05-16T07:03:28+00:00

I have been thinking a lot lately about how code gets organized in a

  • 0

I have been thinking a lot lately about how code gets organized in a layered way. I have been thinking of four different ways:

  1. Instantiation — specifically objects are instances of classes. However, in several languages (like python), classes are also objects that were instantiated from a metaclass. So you can end up with an instance stack of objects.
  2. Inheritance — you end up with a stack of super classes. Even when you have multiple inheritance you end likely have a way to turn it into a stack (like the MRO in python).
  3. Namespaces — scope is typically layered too.
  4. Calls — the call stack is probably the most familiar and the oldest conceptually. It is the mainstay of programming.

You could argue that instantiation is just a different sort of call stack, and that inheritance is just another namespace stack, but regardless these are what I thought of.

So does anyone have any other conceptual stacks that fit in here, or do calls and namespaces sum it all up? Any other thoughts?

  • 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-16T07:03:29+00:00Added an answer on May 16, 2026 at 7:03 am

    I think this is a very good question in that it makes us think about the way we structure software. Structuring software is necessary to create a layer of abstraction between the code and its architecture.

    I have lately come to the conclusion that horizontal layering is a convenient technique, but vertical partitioning is more useful. An example of horizontal layering would be the classical DAL->BAL->GUI scenario while vertical partitioning divides the application into the features that it supports.

    The model of a stack is obviously present in the horizontal layering model. But also when vertically partitioning functionality you can find the stack model. What I find particularly appealing about vertical partitioning is the idea that each of my vertical slices can have its own horizontal layering stack, an idea that is resembled in patterns that grow more and more popular like CQRS. There can also be dependencies between the vertical partitions of your application, again modeled as a stack. But sometimes this is not sufficient and you need a more sophisticated abstraction than a stack, such as a graph.

    Abstracting away from that, I think the reason we like to think in stacks is because we can see things at varying levels of abstraction, pushing/popping things on the stack on demand. Other structures like Graphs are sometimes more suited to describe problems like dependencies between components, but they are more complicated and thus not as convenient as stacks.

    That is also the reason why multiple inheritance was ditched: A graph of dependencies (multiple inheritance) is much harder to understand than a simple stack (single inheritance).

    What else can be modeled as a stack? Frankly, I think what we have here is quite a lot and get’s you very far:

    • Inheritance Hierachies (single inheritance)
    • horizontal, architectual layers
    • vertical architectual layers (feature composition)
    • simple, linear dependencies (call sequences, wrappers, facades)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am thinking about form security a lot lately. I have been told time
I have been thinking and learning a lot about forms lately trying to add
I've been thinking a lot lately about how cool it would be to have
I have been thinking about a way solve a problem I have and I'm
I have been thinking about the optimal way to create an XML file using
I have been thinking about a neat way of load balancing and one thing
I've been thinking a lot lately about a music-oriented project I'd like to work
I have been thinking of a way to export data from SQL to Excel.
I am looking for some input on something I have been thinking about for
I'm working on a toy game engine. I have never been thinking about coordinate

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.