Skip to main content

Posts

Showing posts with the label spock

Programming Foundations - Lotto Session #3 (Kotlin, Spring, & Spock)

In this session, we construct the beginnings of a Lottery application that will utilize the Lotto model we introduced in Session #1 and later refactored (as Kotlin) in Session #2 .  If you missed those sessions, refer to this same blog site to review that content. One new technology introduced in this session will be Spring .  The best way to think of Spring is as a programming and configuration model used to assist with the construction of applications.  Its primary contribution is to provide architectural and design foundations. Specifically, we will be utilizing what is called Spring Boot , which provides convention over configuration and allows you to get started with minimal setup.  What this translates to, is minimal configuration needed to use the Spring framework features. A side note: Spring Framework 5.x and Spring Boot 2.x have first class support for Kotlin, which is another good reason to give this language a serious look! Application Ent...

Programming Foundations - Lotto Session #2 (Kotlin)

Expanding on our lottery model from session #1 we will convert the model from its existing Java form to Kotlin, which is a programming language that is becoming quite popular. More than just being a "brand new toy" Kotlin has been endorsed by Google for Android development, has integration support with the Spring framework libraries, and has excellent integration with IntelliJ IDEA's integrated development environment.  In this session, we will cover the following: Reviewing key concepts learned in the initial session Introduction to Kotlin syntax and grammar Migration of our Java lotto implementation to Kotlin Null handling deep-dive with Kotlin Expansion of our Spock unit testing with Kotlin What is Kotlin? Kotlin was named after a Russian island, west of St. Petersburg in the Baltic Sea.  For comparison, the Java programming language was named after the Indonesian island of Java. Kotlin is a statically typed programming language for th...

Programming Foundations - Lotto Session #1

This tutorial covers key concepts to assist with learning programming best practices and foundations. Examples demonstrate the construction of foundation classes using a lottery pick scenario.  Software best practices include: separation of concerns, abstraction, validations, and testing. If these aren't familiar at all, great, this session will get you started on your way to understanding.  I hope you enjoy learning through this session and upcoming sessions that will build upon one another. Let's get started! This material covers beginning concepts while touching on some intermediate API-level topics.  The following will be included in this session: Create an abstract model to represent a post-transformed lotto drawing. Create a specific subclass that extends the abstract model. Address initialization of state and validations. Construct test coverage to verify the implemented model. Creating a Model A typical lottery drawing...