Skip to content

Instantly share code, notes, and snippets.

View sizovs's full-sized avatar
🌴
Mentoring software developers @ principal.dev

Eduards Sizovs sizovs

🌴
Mentoring software developers @ principal.dev
View GitHub Profile
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;
  1. README.md: no information on how to run and test the app.
  2. README.md: no information on minimum runtime requirements (Java 11+).
  3. Unused code: getSurname(), getLoans(), setLoans(...) etc. Best practice: never write/generate code "just in case".
  4. 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.
  5. API: the API tries to be, but is not RESTful. E.g. plurals should be used: /loans, /loans/{clientUUID}
  6. 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.
  7. Excepti
// 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;
@sizovs
sizovs / osom.md
Last active January 19, 2021 19:48
OSOM.md
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);

Люди, которых упомянали во время курса

  • 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 – написал книгу по
# Self: https://bit.ly/playtech_3
### Slides
http://bit.ly/playtech_1
#### Slides ####
sizovs.net/jninja
#### Books to read ####
- Clean Code (Martin)
- Clean Coder (Martin)
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) {