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

The Archive Base Latest Questions

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

In college I took on a class on modern physics, in which we learned

  • 0

In college I took on a class on modern physics, in which we learned about special relativity. I was completely blown away by how different frames of reference could actually observe physical properties of an object to be different and neither be incorrect. Over time, this concept has slowly been changing the way I program, to the point where now I tend to break up classes into 2 main categories, data objects and observing (function only) objects.

For the sake of this not becoming a elaborate and lengthy post for such a simple question, I’ll try to explain what I mean through two examples.

First, take for instance this type of code, which I used to often write:

class Deck
{
    private Card[] cards;

    public void Shuffle()
    {
        // shuffle algorithm
    }

    // other deck related functions like draw, cut, etc...
}

I typically now write the same scenario as:

class Deck
{
    // by intention, i just mean some kind of immutable collection of cards
    private ReadonlyCollection<Card> _Cards;

    public Card[] Cards { get { return this._Cards; } }
}

interface IDeckHandler
{
    Deck Shuffle(Deck deck);
    // other deck related functions like draw, cut, etc..
}

class Dealer : IDeckHandler
{
    // IDeckHandler implementation
}

The Deck is no longer responsible for implementing the functions which can act on it. Or to make it fit the terminology, the deck is just a set of values and the way in which it is observed is the responsibility of the observer. Naturally, there can be many observers who perform the actions differently.

For the second example, I’ll use something which people I have tried to explain this to have had an easier time with. Take the situation where we have colored letters on colored paper which spell out a word. We have an agent whose responsibility it is to read the word on the paper. Now assume the agent is some type of color blind. The image being emitted from the paper is the same, but the perception could be different. The observer does not have intimate knowledge of the object and cannot modify it, only respond with an interpretation of it.

As I have stated, this concept drives many of my development decisions. So back to the question, is this a published type of programming and if so, can you point me to some literature on it? There are some common and uncommon scenarios I have run into which are difficult to make decisions for, and certainly some things I just haven’t thought of or run into yet which would hopefully have been examined in literature.

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

    What you’re doing is separating the data of the concept from the operations that act on that concept. What the system is from what the system does. This opens the door for many different scenarios, in which you change the behavior of the system by using different behavior classes. These behavior classes can also be reusable for different data classes. Many patterns address this problem, like Visitor, Command, Strategy, or Observer.

    But there’s something deeper at play here. Maybe we need another concept in our (mainstream) programming languages (or maybe just in our minds), that will allow us to separate, and reuse, these bahaviors.

    The DCI architecture addresses these issues, and presents roles, or traits (pdf), as the fundamental unit of behavior and code reuse.

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

Sidebar

Related Questions

In college we studied IBM's MQ Series which was middleware that you could send
public partial class College { public CollegeDetails CollegeDetails; public List<Students> Students; public StaffDetails StaffDetails;
When I was in college learning about web programming, they told us about Hibernate.
I am making a project for college and have made a program which creates
I'm a college student doing a Java homework. I've created this program that allows
Hello I'm a college student studying Java. I'm working on a android application. It
I'm teaching a college course on mobile application development and would like to introduce
I have a college project based on java swing. I wanted to use windowbuilder
Hi Im doing a project for college and have a JTable in my GUI.
I've got a project from my college to make a folder lock application using

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.