Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

mock question

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A computer assembler assembles computer with the combination of 1 CPU, one memory size, one hard disk. available types of cpu's are 1GHz,2GHz,3GHz.
available hard disks are 40GB,80GB,100GB. available memory sizes are 1GB,2GB,3GB.
customer has to choose one cpu,memory & hard disk etc.

what pattern is suitable for this?

answer is builder pattern.
why builder why not abstract factory?
 
Pavel Grushetzky
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because person assembles whole from parts - that's what builder for.

Abstract factory is about creating families of related products. It could fit here if, for example, statement had mentioned accessory compatibility issues.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!