Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interview question

 
Mala Sharma
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I had a interview over telephone today where i was asked the difference between a "class" and a "component". To me this question made no sense so i basically told them the difference between class and a object. Is there an answer to the above asked question or was my understanding right (it was probably HR person conducting the interview). Any comments are welcomed.

Regards,
Mala
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a couple of different definitions of "component", but generally, a component is the smallest unit of software reusability. Sometimes it's one class, but usually it's a group of classes, together with published interfaces and documentation. By this definition, Lucene is a component. An EJB that provides credit-card charging is a component.
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To add more: You can decide upon the components while you are designing your architecture and classes you do it later.
[ September 14, 2005: Message edited by: Arun Kumarr ]
 
Rick O'Shay
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer: it depends on the context but in general a component is a pluggable service. A component may consist of one or more classes plus any associated configuration resources.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic