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

learn more… | top users | synonyms (1)

4
votes
1answer
76 views

Keep or discard tests that use methods now private [duplicate]

When writing object-oriented code from scratch, I try to follow these steps: Write a test that fails. Write a function that makes the test pass. When enough tests and functions are complete, ...
1
vote
3answers
482 views

Should I use different projects for building different layers in a 3-layer model?

I am creating a new project from scratch and have decided to use a 3-layer model. I am using: the 1st layer for business entities, the 2nd layer for business logic, and the 3rd layer for data logic ...
0
votes
4answers
417 views

How to design an IDisposable that unconditionally needs to be disposed?

Consider a class that implements IDisposable, and that has members in such a way that it will never become eligible for garbage collection when it is not disposed. And as it will not be garbage ...
1
vote
1answer
180 views

What is a good practice to push notifications in a “near real-time” delay in this case?

I want to enable some real-time notifications about friend's activities (social network). Technical context is: Webapp calling backend (REST API's). Scenario is: Kevin follows Bob. When Bob ...
2
votes
3answers
225 views

Sequence diagrams and the Implementation

In the design phase we create UML Sequence diagrams (in OOD). My understanding is that after creating an Use Case diagram if we need to show further information in terms of time sequence of events of ...
1
vote
4answers
155 views

MySQL Database design - Opinions

Im working on a web Application for our bussiness with my brother. Our application its pretty simple, will be develop with php and mysql. Clients and providers ABMs Articles Inventory (we do not ...
-1
votes
1answer
88 views

Decomposing a system in to sub systems, modules and components [closed]

This question is about how should a large system be decomposed to sub systems, modules , components etc. For example lets say in a Payroll solution there may be core areas like Attendance, Salary ...
0
votes
2answers
266 views

how to approach pharmacy software project [closed]

I would like to complete a pharmacy software proof concept. But I have a few questions I do not know. Physician information In order to refill or dispense a new RX the software needs to have access ...
4
votes
5answers
2k views

Is this a good practice or not?

I have a colleague who has come up with a way of 'genericizing' information from a database so that all his web application's drop-down lists can share the same object in his MVC.NET C# code and ...
3
votes
2answers
144 views

Program Design clearness vs convenience

I've recently disputed with my colleague about the following situation: I've developed a framework that processes the resources (in java, although its not really important). It goes (simplified, ...
0
votes
1answer
102 views

Developing pages in MVC website that will be specifically used as an iframe by another website

I have a website where I'm going to be partnering with another website. They want to view one specific page of mine, in their [WordPress] website. They aren't developers, so I looked into how to do ...
9
votes
3answers
2k views

Am I wrong in thinking that needing something like AutoMapper is an indication of poor design?

Automapper is an "object-object mapper" for .Net, which means copying objects from a class into another class that represents the same thing. Why is this ever useful? Is the duplication of classes ...
1
vote
4answers
370 views

Good design for a simple site that contains a blog [closed]

What is a good design for a simple web site with mostly static pages and a blog? I am helping a friend build this for their small business. We are looking for a simple approach that can be ...
2
votes
5answers
383 views

Which is better design: Determining if a function should execute from outside of it, or inside of it?

I'm often presented with these two options. From a design point of view, which of these is subjectively better, and why? Option A class foo { private boolean bar() { //Stuff } private ...
4
votes
3answers
84 views

Returning results of method on batch list?

The title is a bit vague so I'll try to elaborate. I have a function makeFoo(int bar) -> returns Foo or throws Exception. I also have a batch version of this makeFoos(int[] bars) -> ...
6
votes
0answers
311 views

How to manage a relatively large one-man project? [duplicate]

I am basically working on https://github.com/KirisurfProject/ entirely alone. This is around 4000 lines of Go code, plus around 1000 lines of Racket (a Lisp) code for the GUI part; the equivalent in ...
0
votes
1answer
81 views

Locking database records

What I have right now: A table with lot of records. About 200 users can select a record according to some rules based on the data in each record. There is a high chance that 2 or more users will ...
8
votes
8answers
699 views

What are the causes that lead to an overbloated software? [closed]

Today I decided to perform a clean install for Creative Sound Blaster drivers, as they always start glitching all by themselves after some time. And that meant I had to go through the whole cleanup ...
0
votes
1answer
96 views

Automatically create or update object in database

I have a database class with the following interface: public Database { //returns false if p (its ID) is already available //otherwise adds p the the list and returns true public boolean ...
1
vote
1answer
153 views

How to structure a program into classes [closed]

So after a while of working in programming field I still haven't figured it out how exactly should programs be structured, in a large set I mean. Which I think it's also because of working in an ...
1
vote
2answers
57 views

Alias variable vs multiple use of getter

Would you rather: $this->getDoctrine()->getManager()->persist($currency); $this->getDoctrine()->getManager()->persist($user); $this->getDoctrine()->getManager()->flush(); ...
-2
votes
1answer
113 views

How can we make a certain thing inbuilt in c language with our own header file?

I want to make the basic trigonometric functions in maths inbuilt functions using my own header file . so as the users can do trigonometry in c language compilers.
1
vote
3answers
177 views

Redundant function to clarify purpose? [duplicate]

Since what matters is not how the code does it but what it does, would you consider wrapping a function with a different name just to clarify it's behavior in certain situations a good practice? ...
4
votes
1answer
412 views

Should I use JavaFx properties? [closed]

I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code ...
8
votes
3answers
1k views

“how bad” is unrelated code in try-catch-finally block?

This is a related Q: Is use of finally clause for doing work after return bad style/dangerous? In the referenced Q, the finally code is related to the structure used and the necessity of ...
1
vote
2answers
325 views

Entirely separate business logic layer from MVC

We are currently refactoring our controller methods in ASP.NET MVC application. At the beginning we've separated data access layer (our goal was to remove LINQ from controllers entirely). Now we are ...
1
vote
2answers
79 views

How to handle enums in an indirection with functionpointers at ANSI-C?

Moinsen, I am somehow stucked in a design problem. Language is ANSI-C. Lets assume we have a tinkerbox of software-modules: one module for the logic Logic (at least) one module doing some logging ...
0
votes
1answer
112 views

Should I persist notification before or after publishing it through Redis pub/sub?

I'm implementing a mechanism to notify a group of users about newly inserted blog comments. The architecture uses the Redis Pub/Sub mechanism. By definition, the pub/sub mechanism aims to propagate ...
1
vote
3answers
115 views

Passing two different types down a chain of calls because of an overload further down

I've got myself into a bit of a mess. I've got code coming from Main, through myMethod and down to OtherMethod. One of the parameters can be either an int or a string, which affects OtherMethod but ...
6
votes
2answers
5k views

AngularJS: structuring a web application with multiple ng-apps

The blogosphere has a number of articles on the topic of AngularJS app structuring guidelines such as these (and others): http://www.johnpapa.net/angular-app-structuring-guidelines/ ...
3
votes
3answers
317 views

Is it feasible and useful to auto-generate some code of unit tests?

Earlier today I have come up with an idea, based upon a particular real use case, which I would want to have checked for feasability and usefulness. This question will feature a fair chunk of Java ...
0
votes
2answers
346 views

Can this code be made more concise? [closed]

I came across some code recently where in many, many places, expression evaluations were being assigned to different arrays one index at a time. A psuedo-code example: array[0] = item1[0] + item2[0]; ...
2
votes
1answer
202 views

How should object identification be managed?

I have a java/swing application in (hopefully good) MVC structure. Here is a overview of my model classes: One or more workers may work at one working location and one worker may work at different ...
7
votes
1answer
232 views

Suggested method for extracting a standalone C library from an existing R package?

My group has been developing an R package to simulate plant growth (see GitHub repository). The R package uses .Call to interface with C. We have decided that it would be worthwhile to create a ...
4
votes
3answers
93 views

Using abstract methods to force subclasses to define values for member fields

Often in my designs I define an abstract superclass whose subclasses will vary mostly in their values for the fields defined in the superclass. For example, in a game I'm developing there's an ...
10
votes
5answers
774 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
54 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 ...
67
votes
11answers
5k 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
229 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
101 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 ...
0
votes
0answers
30 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
1answer
80 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 ...
3
votes
4answers
314 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
470 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
303 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
197 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
152 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 ...
-1
votes
1answer
164 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 ...
2
votes
0answers
46 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 ...