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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:57:40+00:00 2026-05-14T02:57:40+00:00

I have another programmer who I’m trying to explain why it is that a

  • 0

I have another programmer who I’m trying to explain why it is that a UI component should not also be a data-structure.

For instance say that you get a data-structure that contains a record-set from the “database”, and you wish to display that record-set in a UI component within your application.

According to this programmer (who will remain nameless, he’s young and I’m teaching him…), we should subclass the data-structure into a class that will draw the UI component within our application!!!!!!

And thus according to this logic, the record-set should manage the drawing of the UI.

******Head Desk*****

I know that asking a record-set to draw itself is wrong, because, if you wish to render the same data-structure on more than one type of component on your UI, you are going to have a real mess on your hands; you’ll need to extend yet another class for each and every UI component that you render from the base-class of your record-set;

I am well aware of the “cleanliness” of the of the MVC pattern (and by that what I really mean is you don’t confuse your data (the Model) with your UI (the view) or the actions that take place on the data (the Controller more or less…okay not really the API should really handle that…and the Controller should just make as few calls to it as it can, telling it which view to render)) But it’s certainly alot cleaner than using data-structures to render UI components!

Is there any other advice I could send his way other than the example above? I understand that when you first learn OOP you go through “a stage” where you where just want to extend everything.

Followed by a stage when you think that Design Patterns are the solution every single problem…which isn’t entirely correct either…thanks Jeff.

Is there a way that I can gently nudge this kid in the right direction? Do you have any more examples that might help explain my point to him?

  • 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-14T02:57:40+00:00Added an answer on May 14, 2026 at 2:57 am

    Have you heard of Martin Fowler?

    Separating User Interface
    Code

    Anyway, if he wants to go further in that direction of adding render methods to his data controls, have him look at “loose coupling”. It’s okay to create some generic type of interface that gets him halfway there, but the UI component should take it the rest of the way.

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

Sidebar

Related Questions

Hey! I am not trying to push my luck here but I have another
Another question from an app programmer who's trying the first time to get together
I have a Java application that launches another java application. The launcher has a
I have an application that writes to another application and needs to provide the
Put it another way: what code have you written that cannot fail. I'm interested
Between myself and another programmer who are working on the same project we consistently
I'm developing a Linux driver loadable module and I have to use another device
I have code to create another row (div with inputs) on a button click.
I have a situation where another developer is including source files from a project
I have a ListView inside another ListView, and I'd like to hide a table

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.