UML aggregation vs association

Rumbaugh’s statement is the most telling and Uncle Bob’s good advice. As I’ve said elsewhere, Aggregation is semantically so weak as to offer nothing practically beneficial. It only has one valid corner case (acyclicity of recursive relationships) however few people know and understand that. So you end up having to point out in comments anyway. … Read more

Aggregation vs Composition vs Association vs Direct Association

Please note that there are different interpretations of the “association” definitions. My views below are heavily based on what you would read in Oracle Certification books and study guides. Temporary association A usage inside a method, its signature or as a return value. It’s not really a reference to a specific object. Example: I park … Read more

Distinguishing between delegation, composition and aggregation (Java OO Design)

Delegation public class A { private B b = new B(); public void methodA() { b.methodB(); } } When clients of A call methodA, class A delegates the call to B‘s methodB. Rationale. Class A exposes behaviours that belong elsewhere. This can happen in single-inheritance languages where class A inherits from one class, but its … Read more

ElasticSearch multi level parent-child aggregation

You don’t need aggregations to do this: These are the sort criteria: Distance ASC (company.location) Rating DESC (company.rating_value) Soonest Future Availability ASC (company.employee.availability.start) If you ignore #3, then you can run a relatively simple company query like this: GET /companies/company/_search { “query”: { “match_all” : {} }, “sort”: { “_script”: { “params”: { “lat”: 51.5186, … Read more

Aggregation in Pandas

Question 1 How can I perform aggregation with Pandas? Expanded aggregation documentation. Aggregating functions are the ones that reduce the dimension of the returned objects. It means output Series/DataFrame have less or same rows like original. Some common aggregating functions are tabulated below: Function Description mean() Compute mean of groups sum() Compute sum of group … Read more

Implementation difference between Aggregation and Composition in Java

Composition final class Car { private final Engine engine; Car(EngineSpecs specs) { engine = new Engine(specs); } void move() { engine.work(); } } Aggregation final class Car { private Engine engine; void setEngine(Engine engine) { this.engine = engine; } void move() { if (engine != null) engine.work(); } } In the case of composition, the … Read more

Show all Elasticsearch aggregation results/buckets and not just 10

The size param should be a param for the terms query example: curl -XPOST “http://localhost:9200/imoveis/_search?pretty=1” -d’ { “size”: 0, “aggregations”: { “bairro_count”: { “terms”: { “field”: “bairro.raw”, “size”: 10000 } } } }’ Use size: 0 for ES version 2 and prior. Setting size:0 is deprecated in 2.x onwards, due to memory issues inflicted on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)