Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kotlin for Enterprise Applications using Java EE

You're reading from   Kotlin for Enterprise Applications using Java EE Develop, test, and troubleshoot enterprise applications and microservices with Kotlin and Java EE

Arrow left icon
Product type Paperback
Published in Nov 2018
Publisher Packt
ISBN-13 9781788997270
Length 388 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Raghavendra Rao K Raghavendra Rao K
Author Profile Icon Raghavendra Rao K
Raghavendra Rao K
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Kotlin – A First look FREE CHAPTER 2. Kotlin – The Game Changer 3. An Overview of Java EE and Kotlin 4. Kotlin with JSF and CDI 5. Kotlin with JPA and EJB 6. Enterprise Messaging with Kotlin 7. Developing RESTful Services with JAX-RS 8. Securing JAVA EE Applications with Kotlin 9. Implementing Microservices with Kotlin 10. Performance Monitoring and Logging 11. Design Patterns with Kotlin 12. Other Books You May Enjoy

Implementing the builder pattern

The Builder pattern is a creational pattern whose goal is to simplify object construction. Instead of having complex constructors that take a large number of parameters, this pattern provides ways to create objects with different states of representation. It gives flexibility while instantiating a class. It provides builder functions to construct the object step by step, and the object will be returned in the final step.

Consider a class that represents a person. We will have to create person objects with different combinations of characteristics. Say, for example, person with firstName, lastName, age, contactNumber, loginId, and address. The class looks as follows:

class Person {
var firstName: String? = null
var lastName: String? = null
var middleName: String? = null
var loginId: String? = null
var age: Int? = null
var contactNumber...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime