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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:31:07+00:00 2026-05-28T01:31:07+00:00

Background : Picture an artwork of a shape where within it is multiple levels

  • 0

Background:
Picture an artwork of a shape where within it is multiple levels of nested shapes. Change of properties e.g. area and length of any of those shape-within-a-shape will cause all the related properties and shapes to change.

I have a design pattern which goes like this:

I have an object graph called (for discussion sake) “NestedShapes” that has tons of properties which are related to each other, for example, “Area” and “Length”. But the graph is designed to be dumb, i.e. given either value, it doesn’t know how to calculate the other and will not do so.

What happens instead is that the graph can be attached to a GraphManager which takes the top level root node IRootShape in its contructor.

NestedShapes implements IRootShape which also implements INotifyPropertyChanged. GraphManager subscribes to those property changes, and runs the logic to calculate related fields and set the graph to the correct state via IRootShape.

Problem:
Along with IRootShape, I have IShape, ISquare, ICircle etc. which are real C# interfaces. But the problem is for some of these properties I only want them to have setters that are private to GraphManager. I know the implementing shape can still expose a public setter, but I do not want to necessarily expose these on the UI side to be able to set the property from GraphManager. What should I do? Is base classes with internal set the way to go?

  • 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-28T01:31:08+00:00Added an answer on May 28, 2026 at 1:31 am

    Let GraphManager interact with the Base classes.

    Everything else interacts with the interfaces only.

    Do not expose properties in your interface.

    public class Circle : ICircle{
       public double Radius{
          get;set;
       }
    
       /* blah blah ... */
    }
    
    public interface ICircle {
       /* No properties */
    
       /* blah blah ...*/
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want change background picture(a div) with javascript that I will take from database.
Is there a way to make sure a (large, 300K) background picture is always
Background I have been asked by a client to create a picture of the
How can we integrate a picture as a background image for a table.. <table>
I have a grid datawindow with a picture in it's background (with dimensions of
I am unable to get the background picture to show in my pages. I
I am trying to set background picture of my webform. I put the jpeg
In my application I have an image (world map) as background picture. Over this
I use CGContextStrokePath painted on a straight line in a white background picture, stroke
I have a background picture (lets call it B), i want to put an

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.