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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:32:37+00:00 2026-06-17T08:32:37+00:00

While reading about abstraction, I came across the following statement Abstraction captures only those

  • 0

While reading about abstraction, I came across the following statement

“Abstraction captures only those details about an object that are relevant to the current perspective”

For eg.
From the driver’s perspective, Car class would be

  public class Car
  {
     void start();
     void applybrakes();
     void changegear();
     void stop();
   }

From the mechanic’s perspective, Car class would be

  public class Car
  {
     void changeOil();
     void adjustBrakes();
   }

My question,
While designing a system, do we design for one user perspective(either driver or mechanic) or can
we design for multiple user perspective and further abstract out based on user type?

Hope my question is clear.

Thanks

  • 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-17T08:32:38+00:00Added an answer on June 17, 2026 at 8:32 am

    Depending on your use case you might need to deign for multiple users. In your example, if your car will be used by both the mechanic and the driver, then you cannot just ignore one set of users. In that case, you can still abstract details by using Interfaces.

    You could design your object like this:

    interface IDrivable {
        void start();
        void applyBrakes();
        void changeGear();
        void stop();
    }
    
    interface IFixable {
        void changeOil();
        void adjustBrakes();
    }
    
    public class Car : IDrivable, IFixable {
        // implement all the methods here
    }
    

    Now, when a mechanic wants the car, you don’t give him a Car object, instead give him an IFixable object. Similarly, the driver gets an IDrivable object. This keeps the relevant abstraction for both sets of users simultaneously.

    class Driver {
    
        private IDrivable car;
    
        public Driver(IDrivable car) {
            this.car = car;
        }
    
        public driveCar() {
            this.car.start();
            this.car.accelerate();
    
            //this is invalid because a driver should not be able to do this
            this.car.changeOil();
        }
    }
    

    Similary, a mechanic won’t have access to the methods in the interface IDrivable.

    You can read more about interfaces here. Even though this is the MSDN link and uses C#, all major languages support interfaces.

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

Sidebar

Related Questions

Background: While reading about the smart pointers I came across the following sample implementation
I came across the following while reading about how easy it is to redefine
While reading about Google webtool kit, came across a statement saying 'synchronous RPCs are
While reading about mcv3 I came across an attribute name called [ActionName] . It
while reading about cookies i found difficulty to grasp the following statement setcookie() must
While reading the Rails Guides, I came across something I'm unsure about. In the
I am confused about StringPool in Java. I came across this while reading the
While reading about shell scripts and temporary file handling, I came across Symlink Exploits.
Came across the term pigeon computing while reading about how google works.. Can someone
While reading about bitmap processing in C++ I came across this block of code

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.