Core Java

Hai, i attended for one interview they asked me one question In Core Java we have Design Patterns are not? and if there explain abt them
[158 byte] By [jrushia] at [2007-11-27 4:00:42]
# 1

> Hai,

> i attended for one interview they asked

> me one question

> n Core Java we have Design Patterns are not? and if

> there explain abt them

Design Patterns are not language specific; although, some languages support specific patterns more readily.

Any how, you can create a singleton pattern in Core Java; therefore, Core Java can "have" design patterns.

jbisha at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 2
Thank you for sending answers But which topic in core java used by the singleton design pattern could you plz send me the answer for it
jrushia at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 3
Hai Bhagwan!First, read about design patterns. Then, take a look at the API- something about math.
filestreama at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 4

> Thank you for sending answers But which topic in core

> java used by the singleton design pattern could you

> plz send me the answer for it

Ahh, I see what you mean: are there design patterns used in the Core Java implementation.

Look at the Factory Pattern and Calendar.getInstance().

jbisha at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 5
Some background information for the OP: http://en.wikipedia.org/wiki/Design_patterns
DrLaszloJamfa at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 6

> > Thank you for sending answers But which topic in

> core

> > java used by the singleton design pattern could

> you

> > plz send me the answer for it

>

> Ahh, I see what you mean: are there design patterns

> used in the Core Java implementation.

>

> Look at the Factory Pattern and

> Calendar.getInstance().

...and a whole lot of other core classes.

(couldn't edit my previous post)

jbisha at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 7
It is an inappropriate interview question.
GhostRadioTwoa at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 8
> It is an inappropriate interview question.Why? (I'm assuming it was just badly rephrased/translated above)
mlka at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 9

> > It is an inappropriate interview question.

>

> Why? (I'm assuming it was just badly

> rephrased/translated above)

Only the designers of the Java Standard Edition really know what design patterns were implemented in the Java Standard Edition. Or, those that have studied the source code of the Java Standard Edition.

Aside from the basics like Iterator. There is an Iterator design pattern and there is an Iterator class in the J2SE. ... whoppee.

That does not tell me much that the candidate knows what design patterns are or how they are used.

A better question would be, "Tell me how you have used design patterns in applications that you have written". Or, more specific, "can you describe briefly, any Structual design pattern". Or, more general, "how are object-oriented design patterns used?"

These questions will give me more information about what the candidate has actually done, more about the candidate and their knowledge. Rather than what the candidate knows about code that was written by someone else.

I use Java application servers all the time, for the past ten years, and I have no clue about the code/algorithms used to implement the application server, cause I don't create application servers. I create business applications that are hosted by application servers. There is a difference

The interviewers question is like, Do you use Microsoft Word? If you do, can you explain how the Insert Auto Text function is implemented and what, if any, design patterns are used?

The interviewers question also indicates a deficiency in knowledge about the difference between programming language and software design. Probably some technical recruiter poorly trying to assess what they don't know.

"Core Java" is used in the title of many books sold in Borders. Usage of the term "Core Java" is questionable.

GhostRadioTwoa at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 10

It seems like a fair enough question to me. If I was interested in having a

candidate that was knowledgeable about Design Patterns and had some

experience with the SE API I would ask further questions, for sure, but this

question lets me see if the candidate has digested some design patterns,

can spot them in use and has contemplated the API. All good things.

DrLaszloJamfa at 2007-7-12 9:05:18 > top of Java-index,Java Essentials,New To Java...
# 11

> Only the designers of the Java Standard Edition

> really know what design patterns were implemented in

> the Java Standard Edition. Or, those that have

> studied the source code of the Java Standard

> Edition.

Not true. You can just take glance at the API classes and see that they have used design patterns or thought about design pattern. The classes Obeserver and Observable have been inte the API since JDK 1.0.

Kaj

kajbja at 2007-7-12 9:05:19 > top of Java-index,Java Essentials,New To Java...
# 12

> > Only the designers of the Java Standard Edition

> > really know what design patterns were implemented

> in

> > the Java Standard Edition. Or, those that have

> > studied the source code of the Java Standard

> > Edition.

>

> Not true. You can just take glance at the API classes

> and see that they have used design patterns or

> thought about design pattern. The classes Obeserver

> and Observable have been inte the API since JDK 1.0.

>

> Kaj

Kaj, did you read the next sentence of my post?

> Aside from the basics like Iterator. There is an Iterator design pattern > and there is an Iterator class in the J2SE. ... whoppee

Aside from the basics like Observer...

So, if I can read and remember that the J2SE API has classes that share names with design patterns and can recite these in an interview, does that mean I understand and have experience with design patterns?

I don't think so. This is even another stronger point of why this is an inappropriate question. A monkey can even read the API and Javadocs and make the connection. Whoever asked it probably doesn't know anything about design patterns. Poor question, in my opinion.

GhostRadioTwoa at 2007-7-12 9:05:19 > top of Java-index,Java Essentials,New To Java...
# 13
> A monkey can even read the API and Javadocs and make the connection. Okay, monkey, what is the main design pattern that java.io is built upon?
DrLaszloJamfa at 2007-7-12 9:05:19 > top of Java-index,Java Essentials,New To Java...
# 14

> Only the designers of the Java Standard Edition really know what

> design patterns were implemented in the Java Standard Edition.

Not so.

> Aside from the basics like Iterator.

Other patterns can be found in the API.

> A better question would be...

I'd most likely ask them either instead, or as well as. But better/alternative questions existing != inappropriate.

> The interviewers question is like, Do you use Microsoft Word?

> If you do, can you explain how the Insert Auto Text function

> is implemented and what, if any, design patterns are used?

Unrelated.

> The interviewers question also indicates a deficiency in

> knowledge about the difference between programming

> language and software design.

I am confused by that. The APIs are not the programming language. You could clone the APIs in C++ and the patterns used would be the same.

mlka at 2007-7-12 9:05:19 > top of Java-index,Java Essentials,New To Java...
# 15

> > A monkey can even read the API and Javadocs and

> make the connection.

>

> Okay, monkey, what is the main design pattern that

> java.io is built upon?

You missed my point. It is obvious, that if you read the API and Javadocs for the Iterator, Observable classes, then you can make an accurate assumption/connection that they were designed with these design patterns.

GhostRadioTwoa at 2007-7-21 21:01:18 > top of Java-index,Java Essentials,New To Java...
# 16

> I am confused by that. The APIs are not the

> programming language. You could clone the APIs in C++

> and the patterns used would be the same.

I did not say that the APIs and the programming language are the same.

Yes, you could create C++ APIs with the same design patterns.

GhostRadioTwoa at 2007-7-21 21:01:18 > top of Java-index,Java Essentials,New To Java...