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

learn more… | top users | synonyms (1)

10
votes
5answers
691 views

Algorithm for percentage without knowing total number

Suppose there are n lines for a hotline. Whenever a customer calls the hotline, the call is forwarded to one of the n lines. And I want to assign percentage of calling to each of the n lines. ...
0
votes
1answer
49 views

How to support multiple firmware versions?

I'm working on an app which talks to a bluetooth low energy (BLE) device and exchanges customized data with it. Our team has defined the data models and there's a method that will parse the data ...
0
votes
2answers
50 views

Maintaining sequence number for the day while creating file from windows service

I have a windows service which invokes a dll periodically and creates files. The file names should be in sequence. Example files will be myfile1.txt, myfile2.txt....mfilen.txt. The number will ...
2
votes
2answers
321 views

How can I refactor client side functionality to create a product line-like generic design?

Assume the following situation similar to that of Stack Overflow: I have a system with a front-end that can perform various manipulations on the data (by sending messages to REST back-end): Posting ...
67
votes
11answers
4k views

Advice on designing web application with a 40+ year lifetime

Scenario Currently, I am apart of a health care project whose main requirement is to capture data with unknown attributes using user generated forms by health care providers. The second requirement ...
1
vote
2answers
220 views

Need advice on design in Ruby On Rails

For personal educational purposes I am making a site for a conference. One of the object that exist in a conference is a session, which has different states and in each state it has slightly different ...
1
vote
2answers
89 views

Passing central objects around or having global instances? [duplicate]

Having a larger WinForms application with several classes I currently pass references to several "central" objects around to function calls. This leads to more method parameters. Example: public ...
1
vote
1answer
87 views

Designs for outputting to a spreadsheet

I'm working on a project where we are tasked to gather and output various data to a spreadsheet. We are having tons of problems with the file that holds the code to write the spreadsheet. The cell ...
0
votes
0answers
26 views

How to test for performance or locking issues of sharing a database with another app

I have a typical Spring/Hibernate Tomcat webapp that has a user_info table. I’m trying to create another webapp that will do CRUD actions on the user_info table. I'm considering sharing the same ...
0
votes
0answers
32 views

Moving JavaFX desktop app to Java Web Start, can not get by security stops in Java8 applications on browsers [migrated]

I have a desktop application written in JavaFX. It's akin to a FORTRAN batch-type analytical program with a modern PC screen GUI. I need to move it to run on the web, e.g., present a client-side GUI. ...
1
vote
1answer
109 views

From a DDD perspective is a report generating service a domain service or an infrastructure service?

Let assume we have the following service whose responsibility is to generate Excel reports: class ExcelReportService{ public String generateReport(String fileFormatFilePath, ResultSet data){ ...
0
votes
1answer
66 views

Implement RPC via SIP

Look at the following use case. I have a client (Java) application, which wants to get/set the state of another, remote application (C). The communication between them is done via SIP, which is run ...
2
votes
4answers
191 views

Managing client-side and server-side validations in one place

I'm 100% on board with the case that one should definitely use both client-side and server-side data validations. However, in the frameworks and environments I've worked in, the approaches I've seen ...
6
votes
4answers
444 views

Split up large interfaces

I'm using a large interface with about 50 methods to access a database. The interface has been written by a colleague of mine. We discussed this: Me: 50 methods is too much. It's a code smell. ...
3
votes
3answers
287 views

Infinite loop with a singleton - does this type of issue have a name?

I ran into an unusual error while working on my project. To better learn from and remember it, I'd like to know if this type of error has a name or some definition. (The error itself OutOfMemoryError ...
1
vote
1answer
78 views

Nested objects in REST

I have simple set of resources, not more than 10 types, with some one-to-many relationships. For example An order has many entries An entry has many comments A machine can have multiple entries ...
1
vote
3answers
135 views

How to make a random-access archive of text files?

I wrote an application that tests the performance of evolutionary algorithms. This application performs a run of the algorithm which consists of several generations. The data which is produced by my ...
0
votes
0answers
91 views

How to handle vague requirements and a manager who needs continuous output? [duplicate]

I am developing an application where the client requested us to create a calendar.They said add events in it and then show other things.My manager agreed but the development to create the calendar and ...
0
votes
1answer
110 views

How to design a scriptable communication emulator?

Requirement: We need a tool that simulates a hardware device that communicates via RS232 or TCP/IP to allow us to test our main application which will communicate with the device. Current flow: ...
0
votes
3answers
214 views

Application qos involving priority and bandwidth

Our manager wants us to do applicaiton qos which is quite different from the well-known system qos. We have many services of three types, they have priorites, the manager wants to suspend low priority ...
-1
votes
1answer
147 views

All programming functions always return to the If or If/Else statement? [closed]

After learning, coding, and coding even more than ever now, I have noticed a trend in a lot of programming which I do. The trend is that the majority of my functions are if{} or if{} else{} statements ...
0
votes
1answer
63 views

Ensuring non conflicting components in a modular system

So lets say we are creating a simple "modular system" framework. The bare bones might be the user management. But we want things like the Page Manager, the Blog, the Image Gallery to all be ...
1
vote
0answers
53 views

How to Implement URL parameter service correctly [migrated]

I'm about to design an service which handles URL-Parameters in AngularJS. Currently I have two different kinds of parameters. Single valued &param=myValue Multi valued ...
0
votes
2answers
102 views

MVC pattern synchronisation

I am facing a problem in synchronizing my model and view threads I have a view which is table. In it, user can select a few rows. I update the view as soon as the user clicks on any row since I don't ...
43
votes
11answers
10k views

What is the ideal length of a method?

In object-oriented programming, there is no exact rule on the maximum length of a method , but I still found these two qutes somewhat contradicting each other, so I would like to hear what you think. ...
2
votes
0answers
40 views

Broadcasting - Listening to replies

We use JS by the way, but I think it's language agnostic. I'm open to ideas. We have this "pub-sub" framework that we use at work to fix the problem of tightly-coupled code. Works fine. Modules ...
6
votes
8answers
1k views

How to split large, tightly coupled classes?

I have some huge classes of more than 2k lines of code (and growing) that I would like to refactor if possible, to have some more light and clean design. The reason it is so big is mainly because ...
2
votes
1answer
147 views

Working with a large, messy object [duplicate]

I have been handed a very cluttered, "One Ring" object (one object to rule them all). The OR class has 40 fields. These fields map to 16 different objects (the OR has all the fields from the 16 ...
0
votes
1answer
122 views

Mock Objects: Real Issues, Test Driven Design with Java

I'm trying to create a mock class to check the operability of a 'Searcher object', the object I want to mock looks like this: public class Searcher implements AristotelianSearcher { protected ...
2
votes
2answers
144 views

Is it better to draw my own graphics or import images?

I am about to start a Tetris clone using Java as my programming language. While I was designing how it'd be done, I've stumbled upon this question: What would be better, if any difference at all, ...
0
votes
0answers
111 views

Are Parameters Needed?

I am wondering if my parameters are need for the methods? Here is the psuedo-code I currently have: class Transaction is Must contain Date, Payee, Balance Can have Deposit, Withdrawal, Check ...
0
votes
2answers
266 views

Is there a better way to organize my module tests that avoids an explosion of new source files?

I've got a neat (so I thought) way of having each of my modules produce a unit-test executable if compiled with the -DTESTMODULE flag. This flag guards a main() function that can access all static ...
1
vote
2answers
146 views

what to do when UX asks for an ugly, convoluted event driven design and you don't know how to implement it in a clean manner?

I have been tasked with creating a desktop client application that fetches data from web apis and presents it to the user. During the last month or so, I've spent most of my time and energy bringing ...
20
votes
7answers
4k views

Is there a more intelligent way to do this besides a long chain of if statements or switch?

I'm implementing an IRC bot that receives a message and I'm checking that message to determine which functions to call. Is there a more clever way of doing this? It seems like it'd quickly get out of ...
1
vote
1answer
98 views

Best way to let users/visitors alter the website design

What I am trying to do is give the users/visitors the option to alter the whole website based on their taste. So they can move for example the sticky bar from top to bottom, alter background colors, ...
0
votes
0answers
38 views

How would I do a vim-style character text editor in a graphical application?

There's a cool guitar tabbing application that I've used before where you can use the keyboard to move around a character grid. You can put any digit in any character cell. Here is an image: This ...
1
vote
4answers
215 views

Combinatorial explosion of interfaces: How many is too many?

I'm a relative newcomer to OOP, and I'm having a bit of trouble creating good designs when it comes to interfaces. Consider a class A with N public methods. There are a number of other classes, B, C, ...
-1
votes
0answers
93 views

How to design network protocols [closed]

As a programmer, you work on your software design skills. You learn about things such as modularity and reusability and how you can achieve them in code. There's plenty of literature on the subject ...
-2
votes
0answers
51 views

Best way to handle transferring Bitcoins to and from clients? [migrated]

I am making a website that involves storing amounts of Bitcoin sent to me and also sending it back to the same client. I have some questions: Is BitcoinJ is a good API for this? (I am most proficient ...
1
vote
3answers
210 views

After HTML and CSS [closed]

I want to create dynamic professional websites. I have finished learning HTML and CSS, but as I understand, those two technologies allow to create static websites only. I heard about PHP and ...
2
votes
2answers
157 views

Relationship between TDD and Software Architecture/Design

I'm new to TDD and have been reading the theory since applying it is more complicated than it sounds when you're learning by yourself. As far as I know, the objective is to write test cases for each ...
1
vote
1answer
105 views

Dynamic Query Generation : suggestion for better approaches [closed]

I am currently designing a functionality in my Web Application where the verified user of the application can execute queries which he wishes to from the predefined set of queries with where clause ...
5
votes
5answers
403 views

Finding most Important Node(s) in a Directed Graph

I have a large (≈ 20 million nodes) directed Graph with in-edges & out-edges. I want to figure out which parts of of the graph deserve the most attention. Often most of the graph is boring, or at ...
63
votes
7answers
9k views

Should I follow the normal path or fail early?

From the Code Complete book comes the following quote: "Put the normal case after the if rather than after the else" Which means that exceptions/deviations from the standard path should be put ...
3
votes
4answers
2k views

What are good reasons to use explicit interface implementation for the sole purpose of hiding members?

During one of my studies into the intricacies of C#, I came across an interesting passage concerning explicit interface implementation. While this syntax is quite helpful when you need to resolve ...
1
vote
1answer
85 views

Liskov substitution principle with abstract parent class

Does Liskov substitution principle apply to inheritance hierarchies where the parent is an abstract class the same way if the parent is a concrete class? The Wikipedia page list several conditions ...
1
vote
3answers
98 views

How to design database having multiple interrelated entities

I am designing a new system which is more of a help system for core applications in banks or healthcare sector. Given the nature of the system this is not a heavy transaction oriented system but more ...
21
votes
13answers
2k views

How To Deal With Terrible Design Decisions [duplicate]

I'm a consultant at one company. There is another consultant who is a year older than me and has been here 3 months longer than I have, and a full time developer. The full-time developer is great. ...
2
votes
2answers
114 views

Design for an interface implementation that provides additional functionality

There is a design problem that I came upon while implementing an interface: Let's say there is a Device interface that promises to provide functionalities PerformA() and GetB(). This interface will ...
0
votes
1answer
63 views

Interconnect nodes in a Java distributed infrastructure for tweet processing

I'm working in a new version of an old project that I used to download and process user statuses from Twitter. The main problem of that project was its infrastructure. I used multiple instances of a ...