A methodology that enables a system to be modeled as a set of objects that can be controlled and manipulated in a modular manner

learn more… | top users | synonyms (3)

0
votes
3answers
110 views

DDD Request Validation Handling

I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
3
votes
1answer
153 views

What design pattern is used in this delegating scenario?

I am currently having to bend some framework API to fit my usecase. The framework provides generic interfaces such as public interface Processor<T> { T process(T t); } with various ...
2
votes
1answer
64 views

Child class accessing its parent's method from Ancestor method

I find myself right now banging my head with the following issue (in PHP): I have an abstract base class, which has a non-abstract method, inherited and unchanged all over the inheritance chain ...
2
votes
1answer
549 views

Emulation of MMU accessing the contents of the registers

I'm having a play around with emulating a simple old CPU. I've set the structure up, so far anyway, as follows: The device is the main and creates an instance of the CPU. The CPU then creates ...
1
vote
1answer
143 views

Data structures for designing an online book reader

I want to design an online book reader system as a programming exercise. I wrote down the following requirements: Searching a book by title. Bookmarking a book. Mark a book as favorite. Give rating. ...
0
votes
1answer
97 views

How to implement strategy pattern on N-Tier application?

Well, i have a N-Layer MVC project which is something like: Domain > Repository > Application > Presentation I have a feature on the website where the user put some monthly expenses (food, gas, ...
-1
votes
1answer
40 views

Entity validation in DDD

I am always curious how the validation is done for the following: Attribute/Property validation. Using preconditions/invariant/postcondition? for value object use self-encapsulation. Validating an ...
3
votes
0answers
80 views

Finite state machine menu design

I'm creating a FSM in python (it's a step sequencer and sample pad based on a Raspberry Pi 2). Right now there are two states and the third is the Menu. This is handled by a class System which ...
3
votes
0answers
99 views

Refactoring of a client API for avoid duplicated code and unclear passage of parameters

I need to develop an API, the functions of the API are requests that call the service exposed by a server. Initially the API worked like this: class Server: def firstRequest(self, arg1, arg2): ...
2
votes
0answers
39 views

Handling of messages with several indicators

I am currently working on an application, which will show several messages (alarms - warnings - hints) on a cable-connected display. As these messages depend on several indicators I have to decide ...
2
votes
0answers
90 views

Injecting data processing logic into class

I want find more elegant and appreciate way to inject processors into CommandProcessorDispatcher class. Or it can be another one solution (the goal is separate each command processing logic to ...
2
votes
0answers
257 views

JS closures - Passing a function to a child, how should the shared object be accessed

I have a design and am wondering what the appropriate way to access variables is. I'll demonstrate with this example since I can't seem to describe it better than the title. Term is an object ...
2
votes
0answers
200 views

The inheritance argument of zope.interface (providedby vs isinstance)

What limitations does inheritance of an interface through an abstract base class present that are addressed by zope.interface? In the following talk given in 2010 by Jeff Rush about interfaces, at ...
1
vote
0answers
35 views

Why is conditionally using an empty panel in Apache Wicket a bad practice?

When Apache released its list of best practices, they recommended avoiding the addition of an empty panel conditionally and gave the following example of what NOT to do: ...
1
vote
0answers
36 views

WMC Calculation in CK Metrics Suite

I have two classes C1 and C2. C1 has 2 methods and C2 has 3 methods each of complexity value 1. C2 inherits from C1. So, I know C2 has 2+3=5 methods in all. The question is, should I take C2 to have 5 ...
1
vote
0answers
123 views

Where to store formulas and formula “constants”?

I want to implement a database driven payroll system using CSharp. I already did it once, but the implementation sucks so I want to do it again and do it right. My first thought is to create a static ...
1
vote
0answers
76 views

Lazy loading collection data through granular subscriptions and OOP (Meteor.js)

I am transforming my Meteor collection to a class I've created: People = new Mongo.Collection('people', { transform: function(doc) { return new Person(doc); } }); Person has a bunch of ...
1
vote
0answers
141 views

How and where to make global function file in jsp sevlet web application

I am making a website in Servlet&JSP. I am looking for good way to make a specific function file from where I can call and declare my common functions. If I made a java file function. Java, so is ...
1
vote
0answers
165 views

How to separate out below tightly coupled classes

I have two classes which are somewhat tightly coupled to one another. Lets call them A and B. A derives from C and B derives from D. B is the class whose instance is created by the system and then B ...
1
vote
0answers
47 views

Adding new Interface & Replacing Method with Interface Type

Let's say that I have 2 classes: Foo and Bar. `Foo` { List<Bar> bars String bippy() int boop() } `Bar` { int biz() String baz() } Observe that Foo's fields include a List<Bar>. ...
1
vote
0answers
146 views

The finer points of HMVC

I'm new to HMVC and whilst tutorials are great about dealing with the overall details of keeping modules separate and only letting controllers communicate, they aren't so great at explaining the ...
1
vote
0answers
68 views

Modelling network and persistent entity representations

I have an app where I need to synchronize some entities (simply download latest versions of entities from server to client). Entity has bunch of text properties and bunch of resource links (referenced ...
1
vote
0answers
41 views

Class/Object with different sets of configurations, singletons etc (PHP)

I want to produce maintainable code for configuring one or multiple classes differently depending whether in a production or development environment. For example, making a Paypal class/object that ...
1
vote
0answers
80 views

using internal or external iterators over graph edges

I've written some code to manipulate sparse graphs for school work I'm doing, and I have an operation which requires me to loop over all the edges of a graph. The interface I need to implement is some ...
0
votes
0answers
209 views

Structured JavaScript Codes

A while ago I started working on a web application which has a lot of JavaScript code due to having a lot of client-side logic. Before starting, I had had a quick look at a couple of JavaScript ...
0
votes
0answers
59 views

object configured by another class

Below I describe what I'm trying to do and how I think I will do it. What I'm hoping is that a design pattern exists for using one object to configure another. This would allow me to have a nice ...
0
votes
0answers
53 views

Is there a good pattern for building nested form objects with validations?

I'm using the form object pattern to handle data normalization and validation in my app. It's working well for simple cases, but some of my form objects are composites (or roll-ups) of multiple other ...
0
votes
0answers
85 views

C++ object design

I am programming a database similar to Cassandra. I use C++. Simplified database store its data in one or two "memory table" and several "disk tables", all stored in single directory. I have class ...
0
votes
0answers
49 views

Graph curve and actual curve plotted on screen implementation patterns

I'm implementing a graph plotter. There are Curve objects, that contains points of actual XY data. When I plot to screen, I need to calculate the XY points on screen, resulting a PlottedCurve. This ...
0
votes
0answers
98 views

Should URL params and request params be stored in the Request object

Is it acceptable if GET parameters don't reside in the Request object, but in the URL? I am writing a small library in PHP, which represents the Request/Response as different entities and at ...
0
votes
0answers
612 views

Evaluating local storage for data persistence for small, stand-alone applications

TL;DR - I have a standalone application that will remain relatively small. I'm trying to evaluate between using XML files or a lightweight database for local storage of data that needs to be ...
0
votes
0answers
66 views

Why use subtyped functions?

Say you have arguments A1 >: A2 (contra-variant), and return types B1 <: B2 (covariant). The corresponding functions are such that: A1 => B1 <: A2 => B2 Sometimes, this makes sense to me - ...
-1
votes
0answers
39 views

What classes should I use for API -> logic -> API?

I need to fetch some information from an API, parse through it and push the relevant data to another API. How should I design this? One class handling everything? One class per API and one for the ...