INVOCACAO METODO DE UMA INSTANCIA String s = "fred"; System.out .println(s.toUpperCase()); -> "FRED" (.toUpperCase "fred") -> "FRED" (.instanceMember instance args*)
a.b().c().d(); Classes podem ser passadas como argumentos para essa função? Eu não posso adaptar classes de outra biblioteca, preciso sei la, de um decorator
ACESSANDO CAMPOS DE UMA INSTANCIA DE CLASSE Person .getAddress() .getZipcode() -> 01139010 (.. person getAddress getZipcode) -> 01139010 (.. instance-expr member+) (.. Classname-symbol member+)
O site TodoBackend tem implementações de uma API de Todo-list production ready ● Clojure: 168 lines of Clojure (incluindo build configuration) ● Java 7 + Spring MVC: 555 lines of XML, 228 Java lines of code, 56 lines of Groovy ● Java 8 + Spring 4 Boot: 200 lines of Java, 37 lines of Groovy EXCLUINDO CODIGOS DE BIBLIOTECAS E FRAMEWORKS
Cada nova classe ou estrutura vem com ZERO funcionalidade e é completamente isolado de outros códigos que já existem. O que aconteceria se eu usasse um Map cru?
“It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures.” - Alan J. Perlis ORIENTADO A OBJETOS != ORIENTADO A DADOS
Purpose Description Living documentation Use spec to include specifications in Function documentation (fdef) Data Validation Ensure the data entering and leaving the system or its key functions are of the correct form. Test Data Generation Provide extensive test data coverage with minimal code maintenance Generative testing of functions Test functions using their spec defined contract (fdef) Generative scenario testing Specific correct usage paths for known states Development time checking Instrument functions to ensure correctness Derive code from specifications Specify a system of record for data structures, internal and external to the system. https://practicalli.github.io/clojure/clojure-spec/