Thursday, July 17, 2008

Comments on Comments on the Previous post

  • Henry Ware suggested a modification to the builder with abstract members removing a lot of the boilerplate. Incidentally, this is a nice illustration of how nested types can be put to a good use in Scala.
  • Justin ported the code to Haskell, which was very cool.
  • A couple of commenters suggested that languages with support for default parameter values (like Python and Groovy) don't need elaborate constructs such as the builder pattern. There are two ways to respond. One is to remind that the intent of the pattern, specially as originally described in the GoF book, has little to do with optional data. The other is to acknowledge that I probably put too much emphasis on this issue and forgot to mention a very common idiom for building objects in Scala: just declare mandatory "parameters" as abstract vals and optional ones as concrete vals with default values, like so:
    abstract class OrderOfScotch {
    val brand:String
    val mode:Preparation
    val isDouble:Boolean
    val glass:Option[Glass] = None

    And to instantiate:
    val myDose = new OrderOfScotch {val brand = "Bobby Runner"; val mode = OnTheRocks; val isDouble = false}
  • I guess that's it. Thanks y'all.


Anonymous said...

The class "OrderOfScotch" has to be abstract - or a Trait, because there are abstract members...
(trait OrderOfScotch {/*...*/})

Unknown said...

You're right meiko, thanks. I'll update the post to correct the mistake.

omni verma said...

Papers pf Cbse 10th 12th
Cbse 10th 12th papers
Cbse 10th 12th Quesiton papers
Msbte time Table and Quesiton Paper
Msbte time Table and Quesiton Paper Download
Msbte time and Previous Quesiton Paper
Download Msbte time and Quesiton Papers
Msbte time and Msbte Quesiton Paper
Msbte time Table and Msbte Quesiton Paper

iuwekjhbr said...

Please refer below if you are looking for best Online job support and proxy interview from India

DevOps Proxy Interview Support From India | PHP Proxy Interview Support From India | Selenium Proxy Interview Support From India | Hadoop Proxy Interview Support From India | Java Proxy Interview Support From India | Angular Proxy Interview Support From India | Python Proxy Interview Support From India | Android Proxy Interview Support From India

Thank you for excellent article.

mahi said...

Please refer below if you are looking for best Training center in coimbatore

Java Training in Coimbatore | Digital Marketing Training in Coimbatore | SEO Training in Coimbatore | Tally Training in Coimbatore | Python Training In Coimbatore | PMP Training In Coimbatore | Scrum Training In Coimbatore

Thank you for excellent article.

Anonymous said...

Thanks for the interesting blog that you have implemented here. Very helpful and innovative. Waiting for your next upcoming article.
Java training in chennai
Java training institute in chennai
Java course in chennai
Java training classes
Java training
Java programming classes
core java coure

Janu said...

very useful for my research. It shows your interest in this topic very well. I hope you will post some more information about the software. Please keep sharing!

Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery

James said...

Data Science resources are also available online and some educational providers also offer online training of the course. data science course syllabus

Ashok said...

Wow what a Great Information about World Day its exceptionally pleasant educational post. a debt of gratitude is in order for the post.
data science course in India

opbest said...

Awesome dispatch! I am indeed getting apt to over this info, is truly neighborly my buddy.
Likewise fantastic blog here among many of the costly info you acquire. Reserve up the beneficial process you are doing here.

My web page::; 풀싸롱


Kaylee Brown said...

Writing a thesis proposal is not very easy nor more challenging. It is all about concentrating on the study and writing the best proposal within the deadline. As a result, many students find it onerous to write a thesis proposal, as it needs extensive analysis in the field. Some lecturers want a specific structure, as well as scholarly references with minimal plagiarism, in addition to time constraints. When you need to satisfy the format requirements with original, non-plagiarized work, it's good to get a reliable assistance. You can also use our knowledge for thesis proposal help. You don't have to go through the same trouble that your peers and seniors had. We know how real work is happening with the help of experts.

Emberly Joe said...

If you are looking for the best answers for your assignment then you can get the same from here. The complete and detailed answers are available. You are suggested to check the assignment answers online by this direct link.

Anton Dcruze said...

Are you stuck while doing your college assignments or assessment. Don't worry you are not the only one who face issue while crafting assignments. Even scholars face difficulty in crafting their assignments or assessments on their own. There is a simple solution to this problem, hire an assignment expert who will give you a guidance to complete your assignment and attain good marks. You can take any assignment help like HR Assignment Help, CHCPRP001 Assessment Answers help, MYOB assignment help.

Links For You said...

i'd subsequent to to make regarded that this blog clearly satisfied me to take steps it! thanks, each and each one fine reveal...

cyber pc said...

tremendous article, thank you for putting this collectively! this is obviously one allowable publicize. thanks for the important advice and insights you have as a end result furnished right here.....

Roadrunner Password Recovery said...

Thanks for sharing. I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.

skrishtech said...

Thanks for sharing a valuable information.All is very fascinating to learn and simple to grasp. Thanks for sharing such great info. Keep Post These kinds of Articles in the future.
fashion designing course in chennai
interior designing course in chennai
web & graphic designing course in chennai
jewelry designing course in chennai
About us

tech2 said...

Merry Christmas! May God shower your life with unlimited blessings on this day. Wishing your holiday season be filled with sparkles of joy and .Merry Christmas Wishes Text

norsk førerkort said...

kjop forerkort uten eksamen.

cumpara permis conducere .

kopa korkort.

comprare carta conducao.

comprare patente.

kjop forerkort.

comprar licencia de conducir.

pauljin said...

comprar carta
acheter un permis de conduire
Führerschein kaufen
comprare patente b
comprare patente vera
comprare patente
buy driver licence