Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need clarification

 
SampathKumar chinnadurai
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All ,

Recently i bought the Amritendu De's book. I have gone through one of the question and i'm not convinced with the given answer.

The question is

A concrete class Certificate changes frequently . If You wish to inherit Certificate , which design principle will be violated ?

A. Interface segregation principle
B. Dependency inversion principle
C. Open closed principle
D . LSP


Correct Answer is B,

Could you please explain , why he has selected the option B.



Regards,
Sampath






 
SampathKumar chinnadurai
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one more Question ,

Which layer of a Java JEE application constitutes enterprise beans?

A. Virtual Platform layer,
B. Application infrastructure layer
C. Enterprise services layer
d. Compute and storage layer

And the answer is A.



Is there any layer like Virtual Platform layer. I have't heard about it . Any thoughts ?

Regards,
Sampath
 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer to Q1 given in the explanation : Since the inherited classes will also have to be changed, rigid design should be avoided.

Answer to Q2: This question is from the objectives - Describe how the principle of "separation of concerns" has been applied to the layers of a Java EE application. Layers include application, virtual platform (component APIs), application infrastructure (containers), enterprise services (operating system and virtualization), compute and storage, and the networking infrastructure layers.
 
Sameer C Naik
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amritendu De wrote:Answer to Q1 given in the explanation : Since the inherited classes will also have to be changed, rigid design should be avoided.

Answer to Q2: This question is from the objectives - Describe how the principle of "separation of concerns" has been applied to the layers of a Java EE application. Layers include application, virtual platform (component APIs), application infrastructure (containers), enterprise services (operating system and virtualization), compute and storage, and the networking infrastructure layers.


Thanks Amritendu, is there such reference given for answers in your book, this indeed helped a lot
 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book has an answer section for each chapter. I have tried to be as detailed as I can.

Also there is an appendix which contains the books to refer.
 
SampathKumar chinnadurai
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Amritendu De. I gone through the Sun Certified Enterprise Architect for Java™ EE Study Guide book and it gives clear idea about the tiers.

i have gone through most of the questions given in your book . Seems your books covers only OCMJEA5 objectives and not suitable for OCMJEA6 . why the book contains only limited questions except design patterns(it contains 120 qns) section .

Regards
Sampath

 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
70% of OCMJEA 5 topics are included in OCMJEA 6. So I'm assuming the book is still relevant.

As far as questions per chapter, I have only included the ones I can write. For example you cannot write 100 questions on EJB 3 migration. 5 or 10 is fine to understand the concepts.
 
Umakanth Godavarthy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amritendu,
For the 1st Q, I'm inclined towards answer 'C' than 'B' because Certificate class is NOT 'closed' for modification (changes frequently) that can also cause issues when extended, hence violates 'Open closed principle'.
I'm not quite sure if the information in the question is sufficient to arrive at answer 'B' as it is not clear whether you are inheriting Certificate to be used in a higher level module to violate 'Dependency Inversion'.

As I understand, avoiding 'rigid' design is the basic idea behind all the design principles.

Can you please explain.

Thanks.
 
Amritendu De
author
Ranch Hand
Posts: 188
11
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The difference is in abstract and concrete class. If you inherit an abstract class, OCP is the choice but if it is a volatile concrete class, DIP is the choice.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic