- README.md: no information on how to run and test the app.
- README.md: no information on minimum runtime requirements (Java 11+).
- Unused code:
getSurname()
,getLoans()
,setLoans(...)
etc. Best practice: never write/generate code "just in case". - Packaging: according to Common Closure Principle, classes that change together must be packaged together. So, instead of putting closely related classes in different packages (
exceptions
,models
,enums
,repositories
,requests
,services
), put them together or split by domain (lending
,client
). More info here. - API: the API tries to be, but is not RESTful. E.g. plurals should be used:
/loans
,/loans/{clientUUID}
- Architecture: domain model leaks to the API. Instead, we should decouple the domain model from our API/screens, because they change for different reasons. In practice, our APIs should always return DTOs, not entities.
- Excepti
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.homework.services; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.databind.DeserializationFeature; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import com.homework.exceptions.CountryResolverException; | |
import com.homework.models.Country; | |
import com.homework.repositories.CountryRepo; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Configurable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. refactor the code so it's at the same level of abstraction (SLAP). | |
0. | |
Range range = new Range(8000, 8005); | |
var port = Port.freeWithin(range); | |
1. | |
int from = 8000; | |
int to = 9000; |
Этот проект я использую для разных экспериментов. Надеюсь, не запутаетесь :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.hibernate.Session | |
import org.hibernate.SessionFactory | |
import org.hibernate.query.NativeQuery | |
import org.hibernate.query.Query | |
class SomeRepoSpec extends Specification { | |
def sessionFactory = Mock(SessionFactory) | |
def repo = new FundingRepository(sessionFactory); |
- Короткая ссылка на этот Гист: https://bit.ly/playtech_kyiv
- Слайды: https://sizovs.net/jninja
- Видео обоих дней уже лежат в Slack
- Kent Beck – создатель eXtreme Programming. У него есть две бомбические книги: "TDD by Example" и "XP Explained."
- Sandi Metz – придумала термин "echo chambers". Написала отличную книгу по ООП "99 Bottles of OOP." Еще стоит посмотреть все ее доклады с конференций.
- Martin Fowler – написал книгу Refactoring и Patterns of Enterprise Application Architecture (PEAA). Вторую следует почитать, если хотите систематизировать знания по классическим паттерам архитектуры enterprise приложений.
- Michael Nygard – написал книгу по
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Self: https://bit.ly/playtech_3 | |
### Slides |
- Slides: https://sizovs.net/jninja
- Exercises: https://bit.ly/java_practice
- Homework: https://github.com/sizovs/awesome-homework-for-java-developers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://bit.ly/playtech_1 | |
#### Slides #### | |
sizovs.net/jninja | |
#### Books to read #### | |
- Clean Code (Martin) | |
- Clean Coder (Martin) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import java.util.List; | |
class Application { | |
public static void main(String[] args) { |