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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:55:23+00:00 2026-05-28T06:55:23+00:00

What’s the issue with the following, and how would I implement it better using

  • 0

What’s the issue with the following, and how would I implement it better using OO principles?

My app contains a bunch of shape classes which all inherit from Shape – Circle, Rectangle, Triangle, etc. Some of these need to be displayed on the screen, in which case they need to leverage common screen logic, so there’s a ScreenShape superclass which contains the common logic, and ScreenCircle, ScreenTriangle child classes.

  • 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-28T06:55:23+00:00Added an answer on May 28, 2026 at 6:55 am

    I would suggest to make an interface Shape which provides a basic blue print about the shape of the geometric shape and all your classes implement the shape interface and create a separate class ScreenShape(or abstract class) which all of your classes will extend, and provide the method for displaying on screen in the ScreenShape class. for example your rectangle class will be somewhat like this

    class rectangle extends ScreenShape implements Shape
    {
    
    // provide implementation of Shape interace methods.
    
    
    // over-ride ScreenShape methods
    
    public void draw()
    {
    // actual logic of drawing the objects on screen
    
    }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having the following issue in a WinForms app. I'm trying to implement Hotkeys
I have the following issue and I would like to know what exactly happens.
I have the following issue using java 1.4 I try to display a very
Using Visual Studio 2010 .Net Framework 4 C# Linq to Entities Issue I would
The following issue popped up in my open source library, and I can't figure
I have the following issue related to iterating over an associative array of strings
I've the following issue I've a windows application It calls a remote web service
I am having following issue with reading binary file in C. I have read
I have the following issue with a UTF8 files structured as following: FIELD1§FIELD2§FIELD3§FIELD4 Looking
We've encountered the following issue. I like to use the following writing: SELECT Id,

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.