Kotlin Design Patterns & Best Practices - Part 1: Build a Chess Game

Mohamad Rejeb July 22, 2024
Video Thumbnail
Mohamad Rejeb Logo

Mohamad Rejeb

View Channel

About

Hi! My name is Mohamed Ben Rejeb, and I'm an Android developer. I started this channel to teach people the fundamentals of Android and Kotlin Mulitplatform. My goal is to add value to the Kotlin ecosystem and make it easier for anyone who wants to become a better Kotlin developer and doesn't know how to start.

Video Description

Part 1 of Kotlin Design Patterns & Best Practices series. What this series is about?: - In this series we are going to see how we can use different design patterns and best practices in real life projects. What are going to build?: - In this part 1 we are going to build a chess game. The chess game rules are a really good example to use different design patterns and best practices and improve your thinking. What are going to use?: - OOP (Inheritance…) - Functional programming - TDD (Only for a single piece) - Factory method design pattern - Builder design pattern - DSLs - … Project Source Code: https://github.com/MohamedRejeb/ChessGameKmp Figma assets: https://www.figma.com/community/file/971870797656870866 My social Links: Github: https://github.com/MohamedRejeb LinkedIn: https://www.linkedin.com/in/MohamedRejeb/ Twitter: https://twitter.com/MohamadRejeb 0:00 - Intro 1:20 - Create a new kmp project 2:10 - Create Piece Interface 8:55 - Create Pawn Piece Class 15:40 - Implement Pawn Moves Logic 22:00 - Implement a generic Piece Moves Logic 37:20 - Test Pawn Moves Logic 1:04:20 - Build a DSL for Moves Logic 1:11:11 - Create Rook Piece Class 1:14:35 - Create Bishop Piece Class 1:15:00 - Create Queen Piece Class 1:15:24 - Create King Piece Class 1:16:04 - Create Knight Piece Class 1:23:00 - Create Board Class for the game logic 1:32:50 - Build The Game UI 1:54:00 - Encode/Decode Game State 2:08:10 - Test The Final Result 2:10:00 - Outro

You May Also Like

Craft Your Space Today

AI-recommended products based on this video

Loading...
RoboSeal Rechargeable Mason Jar Vacuum Sealer for Mason Jars Wide and Regular, One Touch Vacuum Sealer for Jars, 10 Lids Included, Digital Battery Indicator, As Seen on TV

RoboSeal Rechargeable Mason Jar Vacuum Sealer for Mason Jars Wide and Regular, One Touch Vacuum Sealer for Jars, 10 Lids Included, Digital Battery Indicator, As Seen on TV

(190)
$36.09
Prime
2K+ bought in past month
Loading...
Paint Sprayer Electric Spray Gun: 700W Spray Paint Gun with 1200ml Container, 4 Nozzles & 3 Patterns, Adjustable Air Flow, Easy Cleaning for House Painting, Furniture, Fence, Walls, Door (Red)

Paint Sprayer Electric Spray Gun: 700W Spray Paint Gun with 1200ml Container, 4 Nozzles & 3 Patterns, Adjustable Air Flow, Easy Cleaning for House Painting, Furniture, Fence, Walls, Door (Red)

(126)
$65.99
FREE delivery Wed, Aug 20
400+ bought in past month
Loading...
Paint Sprayer Electric Spray Gun: 700W Spray Paint Gun with 1200ml Container, 4 Nozzles & 3 Patterns, Adjustable Air Flow, Easy Cleaning for House Painting, Furniture, Fence, Walls, Door (Royal Blue)
Best Seller

Paint Sprayer Electric Spray Gun: 700W Spray Paint Gun with 1200ml Container, 4 Nozzles & 3 Patterns, Adjustable Air Flow, Easy Cleaning for House Painting, Furniture, Fence, Walls, Door (Royal Blue)

(97)
$69.99
PrimeFREE delivery Sat, Jun 14
Loading...
Cordless Paint Sprayer for Dewalt 20V MAX Battery.Paint Spray Gun with Powerful Motor and 4 Copper Nozzle.650w Electric HVIP Sprayer for House Painting,Furniture, Wall, Door.(NOT Battery)

Cordless Paint Sprayer for Dewalt 20V MAX Battery.Paint Spray Gun with Powerful Motor and 4 Copper Nozzle.650w Electric HVIP Sprayer for House Painting,Furniture, Wall, Door.(NOT Battery)

(5)
$74.99
FREE delivery Wed, Aug 20
50+ bought in past month
Loading...
Command Medium Picture Hanging Strips [Removable]: 12 Pairs (White)

Command Medium Picture Hanging Strips [Removable]: 12 Pairs (White)

(23,669)
$10.38
FREE delivery Mon, Sep 15 on your first order
5K+ bought in past month
Loading...
2 Pack Outdoor Solar Firework Lights, 240 LED Solar Powered Hanging Lights Outdoor Waterproof Hanging Fairy Garden Lights Landscape Lights(Warm White)

2 Pack Outdoor Solar Firework Lights, 240 LED Solar Powered Hanging Lights Outdoor Waterproof Hanging Fairy Garden Lights Landscape Lights(Warm White)

(41)
$25.99
FREE delivery Sat, Jun 14 on your first order
300+ bought in past month
Loading...
20PCS Beeswax Ear Candles Wax Removal, Ear Wax Candle Ear Wax Removal Kit Earwax Cleaner

20PCS Beeswax Ear Candles Wax Removal, Ear Wax Candle Ear Wax Removal Kit Earwax Cleaner

(0)
$3.99
$8.99 delivery Nov 26 - Dec 5
Loading...
BBQ Lighter,Barbecue Lighter,BBQ Long Reach Refillable Candle Fire for Indoor & Outdoor,Long Neck Adjustable Lighter Butane Gas Refillable Plastic Lighter Kitchen Igniter

BBQ Lighter,Barbecue Lighter,BBQ Long Reach Refillable Candle Fire for Indoor & Outdoor,Long Neck Adjustable Lighter Butane Gas Refillable Plastic Lighter Kitchen Igniter

(0)
$12.99
$1.99 delivery Jun 25 - Jul 8