?
Solved

Java OO Design  - general knowledge

Posted on 2012-04-11
7
Medium Priority
?
508 Views
Last Modified: 2012-04-12
Hi,

First, this is not an assignment.

What is the best answer if people ask you what is OO Design in Java?

You guys are Java experts, how do you tell people what is OO Design in Java if you have a job interview? I know this is a very common question when I do a google search, but not sure what is the best answer for this..

Thankyou in advance
0
Comment
Question by:unistudent
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 23

Expert Comment

by:basicinstinct
ID: 37835505
I explain it as creating "black box" reusable components. Each black box has a known interface which other code can reuse without knowing what's inside the box.

I go on to liken it to having two teams making hardware - one team builds headphones, the other builds iPhones. Neither team cares about the inner workings of the other hardware. Instead they both design to a known interface, in this case the headphone jack.
0
 

Author Comment

by:unistudent
ID: 37835619
Thanks. basicinstinct.

This sounds like a abstract class for me, isn't it? Please advise
Doesn't the following example I gave you, can tell this is a OO Design? Please advise.
For example,
like building a employee record, an employee can be a management role with different salary rank, also, an employee can be a worker with different salary range and applied for penalty rates.

abstract class employee{
  private  string name;
  public   integer emplyeeId;
  abstract  double salary ()
}

class management extend employee {
   double salary() {
   }

}

class worker extend employee {
   double salary () {

  }
   
}
0
 
LVL 23

Expert Comment

by:basicinstinct
ID: 37835979
Well in my example above I didn't really cover class vs object... Everything in my example was an object.

I normally explain classes vs objects either like baking:

A class is a (cake) recipe.
An object is a cake.

Or construction:
A class is a blueprint.
An object is a building.

Your example seems sound.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:unistudent
ID: 37836280
Thanks for advice.

my last question. let's say when i explain to people what is Java OO design, should I just give them this example?

 I should tell them I create employee abstract class and two subclasses linked to their assoicated super class. isn't it?

Yes. I do realise even I can write java OO program, but I am confused and dont know how to explain to people the difference in between class and object. and how OO design used these two technical term..

Thanks
0
 
LVL 12

Accepted Solution

by:
Sharon Seth earned 2000 total points
ID: 37836391
Class and Object are OO concepts . They simply relate to things in the real world . Just like in the posts above , blueprint , buildgin , cake and recipes - all there are real world things . OO design allows you to model s/w components in line with the real world objects.

Coming to your question - When ppl ask you what is java OO design , you got to tell them about more than just classes and objects . You got to tell how each of the OO concepts(abstraction , inheritance and so on) can be implemented in  Java
0
 

Author Comment

by:unistudent
ID: 37836463
Thank you.
Now it is clear now. So next time if people ask me about java OO design I will mention about abstraction and inheritance in writing OO Java program.
0
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 37836936
Not just abstraction and inheritance . I meant all the OO concepts
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Ruby, Call or invoke a API DLL library is easily via Win32API class, win32-api gem or other gems. For general DLL API call, there are quite a few references, some good tips list below: http://www.rubytips.org/2008/05/13/accessing-windows-api-fro…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month7 days, 22 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question