This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Took the beta Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Took the beta" Watch "Took the beta" New topic
Author

Took the beta

Amirthalingam Prasanna
Ranch Hand

Joined: Jan 08, 2004
Posts: 107
Took the beta exam from Srilanka Yesterday. It was a bit tough cosidering i didn't do enough practice. I used the developers notebook and 2 pdf documents from the web.
Have to wait and see how the results goes


Prasanna <br />[SCJA Beta, SCJP 1.4, SCJP 5.0 Beta]<br />[MCSD, MCPD, MCT, MVP]<br /><a href="http://www.prasanna.ws" target="_blank" rel="nofollow">My Blog</a>
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Best wishes on the result.

Nick


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Hi Amirthalingam ,

I read from your blog that you love OO , Can you explain me coupling , cohesion & encapsulation in context of beta exam ...

Can you give me some details , how should I do my last preparation ...

Thanks a lot .
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
Took the exam on Monday. It's really a very tiring experience for me. Never taken such a long-hours exam before. Questions on generics weren't as tricky as I thought. Many questions on thread were asked. One particular question caught me off guard cos I didn't expect it to be appeared in the exam. Surprisingly, for this exam, I prefer the drag-and-drop questions to the multiple choice ones. Unlike other exams I'd taken, there wasn't time for me to check so can't predict how I performed. Like Amirthatlingam, just have to wait and see how it goes...
Amirthalingam Prasanna
Ranch Hand

Joined: Jan 08, 2004
Posts: 107
Hi rathi,
Instead of just going through the definitions try to think of practical scenarios on how you would do implementation for encapsulation, low coupling and high cohesion.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Coupling : Interdependencies .

It should be always less . Every class should do its own function well . In practical word can we say , we should avoid 'Has-a' relationship .

Is this right ? please comment ...

Can any body explain cohesion ?

thanks a lot .
Amirthalingam Prasanna
Ranch Hand

Joined: Jan 08, 2004
Posts: 107
A class should represent one thing and represent it well - Cohesion
A class should have less dependency with other classes - Coupling

If you model your class so that it has the attributes and the methods that work on those attributes as one tight unit thats cohesion.

But your class will still need to use objects from other classes. Don't expose your data just expose methods to work on the data to reduce coupling. You have some good patterns as well to reduce coupling...
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Amirthalingam Prasanna:
A class should represent one thing and represent it well - Cohesion
A class should have less dependency with other classes - Coupling


That is OK



If you model your class so that it has the attributes and the methods that work on those attributes as one tight unit thats cohesion.


I think this is encapsulation ...

But your class will still need to use objects from other classes.

In that case what should we do ???


Don't expose your data just expose methods to work on the data to reduce coupling.


that is again encapsulation ...


please reply ...

thanks .
[ February 09, 2005: Message edited by: rathi ji ]
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Can any body help ...

Thanks a lot .
Amirthalingam Prasanna
Ranch Hand

Joined: Jan 08, 2004
Posts: 107
Hi,
Well when you do proper encapsulation your objects will be high in cohension and low in coupling...
Hope that helps
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
I understand that there is no one acceptable defination for this terms .. but can any body explain me with simple & short exam like this ...

example for encapsulation :
-------------------------



please can any body give me example of cohesion & coupling ..

Thanks a lot .
Amirthalingam Prasanna
Ranch Hand

Joined: Jan 08, 2004
Posts: 107
Just check the following url on how high cohesion should be achieved:
http://leepoint.net/notes-java/15principles_and_practices/15cohesion.html
It is explained using function but its the same for class as well. If you think a class is representing more than one thing then you need to break it into two or more classes.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Thanks for replying ...

Actually I have read that content , And cohesion is clear to me that every function should do one thing well , but at the same time I have listened or read that every class should do one thing well ( one responsibility ) , does it mean that every class should have one function within it ??

please help me out ...

Can any body give an example for low or high coupling ...

Thanks a lot .
David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
The concept is similar between methods and classes, but a class's responsibility will actually be a cohesive set of related responsibilities.

For example, ArrayList.add(Object) adds a single Object to the List. But note that it also makes sure the underlying array has enough space by calling ensureCapacity() and increments the size of the List. While it seems this is many responsibilities, they're really small steps of a single responsibility: adding an Object.

Now ArrayList as a whole has many methods: add(), get(), insert(), remove(), size(), etc. But all of these responsibilities are related under the single responsibility of "managing an indexed collection of objects." Adding a method like ArrayList.saveToFile(File) would be breaking cohesion since it has nothing to do with ArrayList's main responsibility.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Thanks David ,
It is clear to me now . But still have doubt in coupling .
coupling means interdependencies , it should always low . But this is the whole concept of object oriented programming . for example , class A has one method & we need that method in class B also . So we we call that method from A it means B is depending on A . If any body will change that method in A then class B will not work . But still we use like this only , we never write that method again in class B . So class B is depending on class A .

Please clear my concepts ...

Thanks a lot .
Bilal Sallakh
Ranch Hand

Joined: Feb 26, 2005
Posts: 45
The questions were really harder than those in 1.4 mock exams.
As said by others, Threads and Collections questions were tricky.
Also, Other APIs (as in in java.text.*) and Serialization questions were somehow deep.

Questions concerning new features in Tiger were somehow straightforward.


SCJP for J2SE 5.0 (beta)<br />SCJA (beta)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Took the beta
 
Similar Threads
J2SE 1.4 and JAAS
JCP-jdk.14 passed with 54 %
Thanks JavaRanch
******Let's do the counting for those who took the exam****
Did your company pay for your certification?