?
Solved

Java OO Design  - general knowledge

Posted on 2012-04-11
7
Medium Priority
?
525 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

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!

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month16 days, 18 hours left to enroll

864 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