aggregation

Prefer composition over inheritance?

Why prefer composition over inheritance? What trade-offs are there for each approach? When should you choose inheritance over composition? ...

port aggregation on Linux

I have to detect port aggregation configuration on Linux. Supposing that the ifcfg-* files were not updated (configuration was done with ifenslave only), how can I understand which eth? devices are slaves to which bond? devices? ...

Aggregation with two Joins (MySQL)

Hi! I have one table called gallery. For each row in gallery there are several rows in the table picture. One picture belongs to one gallery. Then there is the table vote. There each row is an upvote or a downvote for a certain gallery. Here is the (simplified) structure: gallery ( gallery_id ) picture ( picture_id, picture_gallery_re...

Application log aggregation, management and notifications...

I'm wondering what everyone is using for logging, log management and log aggregation on their systems. I am working in a company which uses .NET for all it's applications and all systems are Windows based. Currently each application looks after its own logging and notifications of failures (e.g. if app A fails it will send out its own '...

Best way to prevent fraud in marketplace app?

I'm developing a marketplace website where tutors and students can find each other. I'm building an online payment system (much like elance or guru.com) where the tutor can get paid and we take a cut. Couple questions: What's the best way to block IP addresses from certain countries like Nigeria? (Note, I am using Ruby on Rails so a...

Is COM aggregation not supportable by most objects?

I have noticed that numerous books, etc. on COM point out that it is relatively easy to implement an object that can be used as an inner object in COM aggregation. However, unless I am missing something, it seems that aggregation can only be successful in extremely limited scenarios and thus support for it should only be provided when su...

Aggregate Objects

If you have a class A that is an aggregate of class B and C, is it better for A to store ID's for B and C to load and store the entire object for B and C (edit, store by reference to object B/C, i.e. instantiate objects B and C as opposed to storing id's for B and C. store the ID's and provide methods to pull methods B and C I'm assu...

How legal is screen scraping?

I'm trying to build an iPhone application that gathers content from real estate websites to display it in a mashed-up and structured manner (mapping, price averages...etc) I've stumbled upon many sites whose "Terms and Conditions" only allow downloading/re-using the data for personal purposes but not commercial ones. My intent is to hav...

jpa inheritance and a OneToMany Relation

Hi all, I have written the following code: @Entity @Table(name="person") @Inheritance(strategy=InheritanceType.JOINED) public class Person { private Long id; protected String email; private String firstName; private String lastName; @Id @GeneratedValue(strategy = GenerationType.AUTO) public Long getId() {...

MySQL: query the top n aggregations

I have a table which counts occurrences of one specific action by different users on different objects: CREATE TABLE `Actions` ( `object_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL, `actionTime` datetime ); Every time a user performs this action, a row is inserted. I can count how many actions were p...

How is an aggregator built?

Let's say I want to aggregate information related to a specific niche from many sources (could be travel, technology, or whatever). How would I do that? Have a spider/crawler who will crawl the web for finding the information I need (how would I tell the crawler what to crawl because I don't want to get the whole web?)? Then have an ind...

managing relationships between agregated / composited members of a class

I am creating entities for a simulation using aggregation and composition. In the following C++ example: class CCar { CCar( CDriver* pDriver ) { m_pDriver = pDriver; } CDriver* m_pDriver; CEngine m_Engine; CDriverControls m_Controls; }; in the above example, a car consists of an engine and a set of driving con...

PostgreSQL Data Analysis / Aggregates

I have a table in PostgreSQL with the following structure & data: Question | Answer | Responses --------------------------------------- Burger BigMac 8 Burger Whopper 19 Burger Cheeseburger 4 Drink Coke 22 Drink Water 1 Drink Juice ...

Django models: how to return a default value in case of a non-existing foreign-key relationship?

I am developing a vocabulary training program with Django (German-Swedish). The app's vocabulary data consists of a large number of "vocabulary cards", each of which contains one or more German words or terms that correspond to one or more Swedish terms. Training is only available for registered users, because the app keeps track of t...

Django conditional aggregation

Does anyone know of how I would, through the django ORM, produce a query that conditionally aggregated related models? Let's say, for example, that you run a site that sells stuff, and you want to know how much each employee has sold in the last seven days. It's simple enough to do this over all sales: q = Employee.objects.filter(type...

How to Show Aggregation in terms of A Programming Code ?

Hi, I know about Association and Aggregation and Composition and Generalization what they are by definition. inheritance is "is a" relationship and composition is "has a" relationship. Class A { } Class B extends A { // this is Generalization } Class C { A ob; // this is composition } now my question is how the Aggregation and si...

Traffic Shaping, Failover tools

I have just become the only IT manager of a small business. We have multiple internet providers (Comcast, Time Warner, XO and Qwest). I'm looking for some solutions that can aggregate those connections, and use traffic shaping to provide the best route. What are some of my options? Free? Low cost? I don't mind using a linux based sys...

Saving associated domain classes in Grails

I'm struggling to get association right on Grails. Let's say I have two domain classes: class Engine { String name int numberOfCylinders = 4 static constraints = { name(blank:false, nullable:false) numberOfCylinders(range:4..8) } } class Car { int year String brand Engine engine = new Engine(...

Aggregating feeds in Rails application

I am thinking of writing a daemon to loop through feeds and then add them into the database as ActiveRecord objects. Firstly, one problem I am facing is that I cannot reliably retrieve the author/user of a story using the feed-normalizer gem. It appears that some times, it does not recognize the tag (I don't know if anyone else has fac...

LINQ | How do I get SUM without grouping?

Crazy question...however, I want the sum of all the rows in a table for a column (without using the group by clause) Example: Table = Survey Columns = Answer1, Answer2, Answer3 1 1 1 4 3 5 3 3 2 I want the sums for each column. Final results should look like: Ans...