java vs oop
TRANSCRIPT
/27@yegor256 7
“Objects may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods”
/27@yegor256 8
“Each object looks quite a bit like a little computer — it has a state, and it has operations that you can ask it to perform” - page 16
/27@yegor256 9
“A class is a collection of data fields that hold values and methods that operate on those values” - page 98
/27@yegor256 12
“An object is the equivalent of the quanta from which the universe is constructed” - page 66
/27@yegor256 15final
- immutability - setters - anemic model - data structures - procedural thinking
/27@yegor256 17
instanceof
- reflection API - no polymorphism - no encapsulation - procedural thinking
.class
/27@yegor256 21
JAX-RS
@Path(“/”) public class Index { @GET @Produces(“text/plain”) public String get() { return “hello, world!”; } }
/27@yegor256 22
Apache Commons
text = FileUtils.readFileToSTring(f); StringUtils.abbreviate(“hello, world!”); DigestUtils.md5(“some text”);
/27@yegor256 23
JPA
@Entity(table = “book”) public class Book { @Id public int id; @Column public String title; }