2
votes
2answers
251 views

Does it make sense to use interfaces if you don't have polymorphism?

Suppose I have distinct classes that have the same behavior, which can be represented like this: public interface Behavior { void operationA(); } public class ImplementerA implements Behavior { ...
3
votes
3answers
469 views

Functional programming strategies in imperative languages

I've been convinced for awhile now that some strategies in functional programming are better suited to a number of computations (i.e immutability of data structures). However, due to the popularity of ...
8
votes
4answers
802 views

How do we keep dependent data structures up to date?

Suppose you have a parse tree, an abstract syntax tree, and a control flow graph, each one logically derived from the one before. In principle it is easy to construct each graph given the parse tree, ...
2
votes
3answers
260 views

Dependency injection and ease of use

I'm writing a handy library (we'll call it Thinger) that goes off and fetches an XML document, does some X-Path query on it and does something helpful with the result of that. (What I'm actually doing ...
1
vote
1answer
150 views

How to share common methods if objects have different roles?

If 2 classes have the following in common: part of how their state is represented (both have a linear container) multiple identical methods (identical code, not just signature) But are not ...
0
votes
2answers
175 views

When modeling a virtual circuit board, what is the best design pattern to check for cycles?

To make it simple assume you have only AND and OR gates. Each has two inputs and one output. The output of two inputs can be used as an input for the next gate For example: A AND B -> E C AND D -> F ...
2
votes
2answers
1k views

Relationship between SOA and OOA

Thomas Erl defines SOA as follows in his site: Service-oriented computing represents a new generation distributed computing platform. As such, it encompasses many things, including its own ...
7
votes
6answers
4k views

Design: Calling back to the parent class

When modelling an object with children it's common to include the children via composition, as a member of the parent class. Sometimes however the children need to tell the parent something, they need ...