Tagged Questions

Questions about problem solving and planning for a solution through software design.

learn more… | top users | synonyms (1)

4
votes
1answer
285 views

What is RESTful way of action confirmation?

Some of my API actions require SMS confirmation due to security reasons, like creation of payment and CRUD for scheduled payments. Right now I just return an entity with AwaitingSMSConfirmation state ...
2
votes
2answers
208 views

Implementation Coupling

This question is regarding Interface Segregation Principle Best-Practices. I use abstract examples below, but the question arises from actual code I've seen that performs what I can only call ...
1
vote
1answer
217 views

Designing classes the right way [closed]

I am trying to design my classes in the optimal way for the following scenario. A city has metro lines covering a number of stations.There are 4 lines represented by 4 colors.The user has to enter ...
0
votes
2answers
145 views

Hexagonal architecure - handle multiple returns from domain logic

I'm looking at using hexagonal/ports & adapters design in some code I'm working on and for the most part I'm happy but there is one part that I'm struggling with which how to handle the need for ...
0
votes
0answers
49 views

WCF Client Data model best practices

Hi I am building a WCF Client Application (not web) for a service I have virtually no control of (different BU) and would like to separate the service consumption from the application business logic ...
2
votes
3answers
156 views

Refactoring web pages with user controls

Is it good design to use many user controls to help refactor a web application? In my case, it's a VB.NET Webforms ASP.NET website. All our pages are organized into sections that, while related and ...
2
votes
2answers
187 views

Design - Parser.hasInfo(MyClass) vs MyClass.hasInfo()

I'm working on a document processing system. I feel confident with a Document class which represents each document being processed. The issue: Each Document can have a CoverSheet, and if it does, ...
-3
votes
1answer
150 views

Efficient Code Design for Pattern Search

I wish to build code for detecting patterns in streaming data. I wish to have clean code that is easily extensible, and easily maintainable. My current code design is below but, to my knowledge, I ...
1
vote
2answers
181 views

Naming conventions DAL, BAL, and UI Layer [closed]

I am developing a typical Web Application with the following layers UI Layer (MVC) Business Logic Layer (BAL) Data Access Layer (DAL) Each layer has its own DTO object including the BAL and DAL. ...
2
votes
1answer
128 views

Efficient Code Design for Pattern Search Using a Singleton Pattern

I am having difficulty figuring out an efficient (thread-safe) code design for the following problem. I have been at it for some time now and would really appreciate some advice and input on how best ...
4
votes
1answer
389 views

avoiding multiple calls to SQL while being modular

I have a BusinessLayer.dll which calls DataAccessLayer.dll which ultimately makes the tcp connection to the SQL server. Each business layer method has a corresponding method in the data access layer ...
2
votes
2answers
143 views

How do you solve issue of consistency in concurrent and distributed application (built around Bankers Dilemma)?

This is a classic problem which I'm sure has been solved many times by many different people. I don't have any formal training (I've not studied computer science or any other such academic subject) ...
0
votes
0answers
23 views

Designing Document class for Doc Imaging - optional fields

I'm working on a project that processes many Documents. A Document CAN have a Cover Sheet (if the first page is one) A Document CAN have a Stub (if Document is large) It matters whether or not a ...
1
vote
1answer
212 views

Exceptions: What to handle, what to throw

I have a custom configuration reader which performs various functions on top of .NET's CloudConfigurationManager and ConfigurationManager implementations, such as caching, type conversion, etc. The ...
0
votes
1answer
108 views

Logic based on modified fields of a Hibernate entity

I have a Hibernate entity object MyObject with several attributes and a service MyObjectService containing business logic dealing with MyObject. I also have a view model dealing with user input/output ...
0
votes
1answer
124 views

Common Methods for communication between Offline Software and Web Application?

The purpose/s of this question is to discover what are some of the most reliable methods of achieving communication between existing offline software and a web application. (Example) Scenario: A ...
4
votes
1answer
93 views

Handling interface segregation in C++

I'm designing a "view" handling system for a game. The goal is to be able to have different "views" that can be shown in sequence or stacked on-top of each other. For example, the initial splash ...
0
votes
0answers
68 views

Database-like structure in memory

I need a database-like structure that will wrap this: data MsgPackDB = MsgPackDB { dim :: !(V.Vector Int) , rows :: !([DBRow]) } data DBRow = ...
3
votes
4answers
506 views

How to force “program to an interface” without using a java Interface in java 1.6

In java 1.8 they have wonderful new "default interface methods". In 1.6 how close can we come? The goal: keep clients (using code) from being able to tell that a class is not a java interface. If ...
0
votes
1answer
114 views

Static methods vs Interface implementation

Here is my problem: I stared to create a e-commerce web sites info collector. So i created a parser for each site. The parser class is state less. got methods like: getItemPrice(WebElement page) ...
28
votes
8answers
6k views

When writing object-oriented code, should I always be following a design pattern?

Is there a conceivable design pattern for any object-oriented program? I ask this because recently I saw an implementation of a Door class with a Lock. It was part of a test and the answer said that ...
1
vote
2answers
53 views

Class template specialization for implementing Automata

I'm implementing classes for simulating and generating different kind of automata. I'd prefer to use the same State and Transition classes for all the automata: NFA, DFA, PDA, etc. For a PDA a ...
1
vote
1answer
136 views

Progress in PHP web application design [closed]

I have created an easy database-driven web application (with PHP+MySQL). It's written procedurally with a few controllers (index.php) in a few directories and a few template files and one stylesheet. ...
0
votes
1answer
103 views

translating a list of words (word1, word2 and word3) [closed]

We are trying to globalize an application and we have run into a situation where I'm not sure how (of if) we would go about formatting the string for globalization. It's a paragraph explaining ...
3
votes
3answers
374 views

Separating Code into Smaller Files in C

I am in the process of cleaning up my code and making it easier to maintain. I am doing this by turning my 5000+ line file into separate smaller files. I have successfully created separate source and ...
3
votes
2answers
191 views

Decision making and maintenance

I'm trying to find an elegant way to implement a decision making algorithm that allow easy maintenance because the conditions for the decision making might change often. I'm going to try and be more ...
1
vote
1answer
83 views

When is it acceptable for business logic to be exposed on distributed applications?

When developing applications (for simplicity, use a client-server model) intended to be deployed on customer systems, when it is acceptable to expose business logic outside of compiled code (for ...
18
votes
4answers
2k views

Is there a good reason to make pure functions non-public?

I had a little debate going on with a coworker. Simply put, is there a good reason to hide/encapsulate functions that are pure? By "pure" I mean the wikipedia definition: Always returns the same ...
0
votes
1answer
74 views

Strategy vs Publiser-subscriber pattern

Let's say I have a channel endpoint where I receive messages. Because I want to process messages in a different way depending on its Header property, rather than create a massive switch I create ...
0
votes
0answers
62 views

Am I following a good design thought process? Is the Abp framework overkill?

As I finish one project and start another, I have a small time window to come up with an architecture for the new. I am coming from the following design: Web applicationReceives domain models & ...
1
vote
1answer
338 views

Erlang chat app design?

I have a chat app made in node/socket.io. Scalability factors have made us choose Erlang/Ejabberd/xmpp and it will replace node/socket. I have a few questions: Currently using MySql for chat ...
0
votes
0answers
74 views

Is one of these the more “Angular” way of communicating with a directive?

I am working on a project where I would like to encapsulate a directive library and distribute it to other developers to use. I would like to keep the changes to the model within this encapsulated ...
2
votes
3answers
290 views

Which approach is right doing use case first or classes first ? why? [duplicate]

There are people who prefer to do use cases first and then do the classes, but there are also some who prefer to do class diagram first and then use cases. So is it personal choice for convenience? ...
1
vote
1answer
106 views

Java Modal Object Design

This question is not about a specific program. This is about design - the UML phase of the project. I am supervising a Java project. It will contain a lot of modal popup dialogs. From a C/C++ ...
1
vote
1answer
258 views

When creating a library, is there a way to make certain classes entirely internal to the library, and not exposed to the user of the library? [duplicate]

Suppose you were designing a Java library for other people to use. You compile the library into a JAR that they can import into their projects and use. Needless to say, you intend for the library to ...
1
vote
1answer
159 views

Why does `SortedDictionary` not implement `IReadOnlyDictionary`?

The .NET type SortedDictionary<TKey, TValue> does not implement the interface IReadOnlyDictionary<TKey, TValue>, although Dictionary<TKey, TValue> does. It is trivial to make ...
2
votes
4answers
486 views

When should something be a class? And are my chosen classes good OO design?

My background: I am new to programming. Python is my only programming knowledge. I program as a hobby, and I'm teaching myself by reading copious amounts of books. I understand enough about OOP to ...
1
vote
2answers
106 views

Which design pattern for a single class accessing an object representing a data structure?

Which design pattern should I use when I have a class representing a data structure (aka C-style struct) and I wish to have only a single class to be able to access it. I was thinking of simply ...
2
votes
2answers
135 views

Building a string parser for user command and control?

My goal is to build a command parser that has basic syntax and multiple possible branches at each point. These commands come from users of the system and are text input (no GUI). The basic syntax is ...
4
votes
3answers
326 views

database design, how to handle freelancers

The context i'm modeling a database for a small ERP system. However I've recently hit a difficult spot that I'm having a hard time wrapping my head around. The logic of it involves a few special ...
0
votes
2answers
156 views

Is this instance of mixing FP and OOP a good design?

I had a strange-feeling pattern come up in some code I was writing. In a project with user accounts, there was a lot of code that needed to do common things such as creating accounts, deleting them, ...
3
votes
1answer
207 views

Is this caution in Android API documentation an indication of suboptimal design?

The content below is from the Android developer site: According to the phrase it is expecting the developer to store this info in his head. Shouldn't this be simple if they kept only ...
1
vote
1answer
126 views

Are CRUD operations intended to be used with collections?

CRUD operations, by definition are... interfaces that permit users to create, remove, modify or retrieve data Implementations of CRUD interfaces can come in various shapes and sometimes they are ...
1
vote
2answers
130 views

Why do IoC containers provide public Resolve method(s)?

In my opinion it just inverses the inversion and could make new users (including myself) make incorrect assumptions about using IoC containers. It can be used for the Service Locator (anti-)pattern ...
1
vote
2answers
252 views

Email service or simply abstract email out and call from?

Got a fairly large web application in asp.net using C#. Also have a mobile setup using a common api that we wrote to basically share data across both of our apps using web methods and common classes. ...
11
votes
4answers
689 views

Is it an overkill to wrap a collection in a simple class only for the sake of better readability?

I have the following map: Map<Double, List<SoundEvent>> soundEventCells = new HashMap<Double, List<SoundEvent>>(); This HashMap maps double values (which are points in time) ...
0
votes
0answers
111 views

How far to go when future proofing fluent-method-chained-DSL test code?

Is it worth implementing interfaces, or using the getThis() trick, or even static factory methods to future proof against the need to extend this DSL? The current design is a pair of thin ...
0
votes
0answers
34 views

Efficiently extracting data from pdf with a template system?

basically allow a user to label specific text in a pdf file. Use the label information to create a template, which a script uses to extract text from specific pdf. What would be a good pattern to use ...
0
votes
1answer
110 views

Properly design program database to reflect organization structure

I'm having trouble setting up my program's database the 'right' way. I was hoping you guys could give me suggestions on doing it properly. I am creating a database+client for a non-profit organization ...
2
votes
1answer
115 views

How do I avoid duplicating utility functions across modules?

I've seen this question but it doesn't help me because I'm writing functional code (Standard ML) and the answers there are heavily focused towards OOP (the OP is advised to use the Facade pattern, to ...