Solved

Java OO Design  - general knowledge

Posted on 2012-04-11
7
479 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now