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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:08:04+00:00 2026-06-17T07:08:04+00:00

I’m posting this in Lua and Codea, since that’s what I’m using, but it’s

  • 0

I’m posting this in Lua and Codea, since that’s what I’m using, but it’s a pretty general question I think.

I’m considering an overall design pattern for displaying graphics, and I’d like to know if there are problems with it.

Here’s the design pattern I’m considering:

A setup() method in a Main class tells a Graphics class to create some graphic elements: for instance, two squares and an ellipse.

The Graphics class generates the parameters needed for each element, stores them as a table, and sends the table to a Data class.

When the app starts drawing, the draw() function in Main tells the Graphics class to draw the objects that were created.

Then the Graphics class asks the Data class to hand back all the tables that it sent over during setup(), and it uses them to draw the elements.

Main commands Graphics which commands and queries Data. I’m sure this is a known pattern: are there problems generally associated with it?

  • 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-17T07:08:05+00:00Added an answer on June 17, 2026 at 7:08 am

    What you’re doing – which is essentially model-view-controller, is commonly used in industry and application development. It works relatively well, although no programming paradigm is without its flaws. That being said, MVC is designed for large teams working on large projects. It is logistically impossible for multiple people to work together on a single Codea project, so given that you’re working on your own I’m guessing the project is going to be small to medium scale. When working solo on projects like this, a pragmatic, intuitive approach is by far the best option.

    Using MVC on something like this is a little bit like building an entire democracy, complete with a congress/parliament, head of state, and court system just to manage the goings-on of a single household. Democracy is good, and a robust system of elections and checks-and-balances is the only way to keep the system running smoothly. In a household, however, even though order and happiness still needs to be maintained, the approach is completely different.

    For you, the best you can do is think about how the thoughts are structured in your head. Do you think of a hoard of enemies as a single entity, or as a collection of autonomous objects? Do you consider a spaceship to be a perfect mathematical collection of properties, or an image the user interacts with on the screen? When the pause screen appears, is the game screen still there, just hidden, or has it ceased to exist and been replaced?

    Moreover, how do you structure ideas? Do you start with broad categories, working down into ever-finer detail, or do you have a vivid mental image in your head that you strive to build a world for? Does your concept of a program consist of a vast flowchart that dips into reality at certain points, or a collection of nodes sending messages to one another? All of these are questions only you can answer. If you naturally gravitated toward MVC, you may want to stick with it. If you read about it in a book, and decided that, even though you didn’t really see why it was useful, it must be some sort of magic pixie dust you can sprinkle on any project to make it easy, I’d urge you to reconsider.

    Happy coding!

    By the way, I think this question is a little better suited for Stack-Exchange programmers than stack overflow. It’s a subtle distinction, but Stack Overflow is for facts, like bug-fixes and algorithms, and Programmers is for opinions on how to write software.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I have a French site that I want to parse, but am running into
I know there's a lot of other questions out there that deal with this
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.