• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Object Orientation

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Helo, all, I guess
Soo, the exam requires to recognize the "is a" / "has a" (ie. inheritance versus composition) ways to reuse. ?!
Well, thats what I think out of the the Sun objectives and various preparing reference material. Now what I am trying to say? Recognizing things differs a lot from designing things, er, in my opinion, the exma requires that you can say that things are something / has something, but does not care whether you actually can choose right way of reuse when you design something.
------------------
Antti Barck
It Solutions Consultant -- NSD Oy
Sun Certified Programmer for the Java™ 2 Platform
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Antti,
Think they want you to be able to recognize, from a code example, when an object 'is a' type vs being an object which 'has a' type.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Jane Griscti (edited August 26, 2001).]
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Antti, i remember that from JQ+ mock exam, there are three kind of relations, ie.

are they the formal way to call it? Do we expect them appear in the real exam?
Guoqiao

Originally posted by Antti Barck:
Helo, all, I guess
Soo, the exam requires to recognize the "is a" / "has a" (ie. inheritance versus composition) ways to reuse. ?!


 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jane Griscti:
Hi Antti,
Think they want you to be able to recognize, from a code example, when an object 'is a' type vs being an object which 'has a' type.
Hope that helps.


Okie. Now where do I start to design things rather than recogning things: in real life projects or developer exam? Or maybe both?

------------------
Antti Barck
It Solutions Consultant -- NSD Oy
Sun Certified Programmer for the Java™ 2 Platform
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

are they the formal way to call it? Do we expect them appear in the real exam?
Guoqiao
[/b]
</BLOCKQUOTE>
All of those appears sound to me, but I am not sure about the formality? Someone else?
It guess ;> that there are no named concepts in the exam, you just regocnise things from the question set at hand.

------------------
Antti Barck
It Solutions Consultant -- NSD Oy
Sun Certified Programmer for the Java� 2 Platform
[This message has been edited by Antti Barck (edited August 27, 2001).]
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a class extends another class or implements an interface, then an 'is a' relationship exists (don't forget every class implicitly extends Object).

<code>One</code> 'is a' <code>Zero</code>
<code>Two</code> 'is a' <code>MyNumber</code>
If a class contains another object then it 'has a' relationship with the contained object.

<code>Three</code> 'has a' <code>String</code> object.
If you can replace a reference to the object with it's superclass type then an 'is a' relationship exists.

The above works because every <code>One</code> object 'is a' <code>Zero</code> object as well.
But you can't say <code>String s = new Three()</code> because a <code>Three</code> object 'has a' <code>String</code> object; it isn't a <code>String</code> object itself.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
reply
    Bookmark Topic Watch Topic
  • New Topic