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

learn more… | top users | synonyms (1)

1
vote
1answer
229 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
0answers
21 views

trigger chat across multiple devices?

I am building up a chat app. I am struggling with the idea of syncronizing the chat messages in real time. My Scenario : trigger chat messages(incoming and outgoing) on multiple devices? ...
0
votes
1answer
41 views

CQRS atop of SOAP component

I'm trying to adapt CQRS in my application. I really like how it simplifies domain model. There is a component with some part of a business logic which is accessible through SOAP. Commands and queries ...
87
votes
11answers
11k views

The modern way to perform error handling…

I've been pondering this problem for a while now and find myself continually finding caveats and contradictions, so I'm hoping someone can produce a conclusion to the following: Favour exceptions ...
0
votes
1answer
73 views

How to determine which service to call

I have modeled my application using multiple 'user' domain objects. Candidate Recruiter Administrator Each entity extends from an AbstractUser implementing UserInterface. interface UserInterface ...
1
vote
4answers
272 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
vote
2answers
243 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: ...
-4
votes
0answers
14 views

How do I create the windows explorer kind of search bar with QT [on hold]

I am currently writing a program with QT using sqlite database and I need to write code to query the database and I want it to be like the search bar in Windows. such that as the user types, it brings ...
6
votes
3answers
207 views

Decentralized Data Management - encapsulating databases into microservices [closed]

I've recently been taking a course on Software design and there was a recent discussion/recommendation about using a 'microservices' model where components of a service are separated into microservice ...
48
votes
9answers
36k views

Why use partial classes?

In my understanding, the partial keyword does nothing but allow a class to be split between several source files. Is there any reason to do this other than for code organization? I've seen it used for ...
2
votes
4answers
44 views

Handle server-side/client-side when for showing missing information as placeholders

I have a database table which stores Incident details. Each Incident can have an image saved for it. There are some Incidents which will not have an image for it. I have an API which pulls the image ...
1
vote
2answers
116 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 ...
5
votes
1answer
157 views

Log to file or to database table?

I'm developing a web application which uses MS SQL for various data: including users, user accounts, user licenses, license prices, invoices. I need to log users' real-time usage of the system, and ...
0
votes
2answers
139 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 ...
0
votes
0answers
85 views

Better way than scrolling a long list [migrated]

I have a mobile app that allows you to browse lists of songs: [a][b][c][d][e] Elvis - Song 1 Elvis - Song 2 Elvis - Song 3 Ernie Wood - Song 4 You can jump to the letter to filter based on the ...
3
votes
3answers
243 views

Best approach for tracking dependent state

Let's pretend I work on a project tracking application. The application is a database backed, server hosted, web application. In this application there are Projects which have many Activities which ...
6
votes
5answers
223 views

Algorithm to test file equivalence

I'm writing a program that needs to test if a file is equivalent to one or more other files. To accomplish this, every time we see a new file we stat the file and get the size. We use the size as a ...
23
votes
2answers
5k views

How to improve upon Bloch's Builder Pattern, to make it more appropriate for use in highly-extendable classes

I have been greatly influenced by Joshua Bloch's Effective Java book (2nd edition), probably more so than with any programming book I've read. In particular, his Builder Pattern (item 2) has had the ...
1
vote
1answer
231 views

Designing the bridge between REST layer to service layer

I am working on a project and would like to expose some REST services. The technologies used are RestEasy, EJB and JPA/Hibernate. I have structured my app so that there is a clear delimitation ...
0
votes
3answers
222 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 ...
1
vote
4answers
204 views

Member variables versus. state variables? [closed]

Sometimes we declare a member variable in the scope of class but we could do the same by providing input to and getting outputs of the functions. I am learning that member variables are to hold the ...
3
votes
0answers
119 views

How to handle a memory consuming member variable

Suppose multiple objects of the same class should do something which takes a memory consuming resource. Which of the following approaches is recommended to define and use the resource by the objects? ...
0
votes
0answers
38 views

adding model specific CRUD operation web api endpoints

Are there are any major design flaws / smells in creating a web api as described below The models I have public class CourseModel { public String Name {get; set;} public ...
7
votes
3answers
171 views

How to model and store an entity which has “one or more” values

I'll use C# to design the model to be persisted Let's suppose I have the following entity: public class Episode { public int Id { get; set; } public string Title { get; set; } public ...
1
vote
2answers
64 views

Explicitness, verbosity and their counterpart - when to prefer which?

I'am the only one in my team who advocates for adding a little implicitness in favor of codebase reduction and decreasing repetition. Yet I don't want to be a biased 'Bad apple' playing against ...
10
votes
8answers
3k views

Data structure for accessing units of measure

TL;DR - I'm trying to design an optimal data structure to define units within a unit of measure. A Unit of measure is essentially a value (or quantity) associated with a unit. SI Units have seven ...
3
votes
2answers
1k views

Designing an email system to guarantee delivery

Summary: We are looking to expand our use of email for notification purposes. We understand it will generate more inbox volume, but we are being selective about which events we fire notification on ...
1
vote
2answers
197 views

Mocking the context of application

We have a context of the application which is a static class named Holder containing several static properties initialized by objects that are used throughout the application. All over the unit tests ...
1
vote
2answers
410 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 ...
22
votes
5answers
1k views

Saving an object via a method of its own or via another class?

If I want to save and retrieve an object. Should I create another class to handle it, or it's better to do that within the class? Or maybe mixing of both? Which is recommended according to OOD ...
7
votes
4answers
832 views

Is there something as a bug-free application? [duplicate]

We are developing an application that goes through many testers before reaching our client. Finally, when it reaches the client, they find some more bugs and report to us, and this has become a ...
75
votes
16answers
14k views

Is premature optimization really the root of all evil?

A colleague of mine today committed a class called ThreadLocalFormat, which basically moved instances of Java Format classes into a thread local, since they are not thread safe and "relatively ...
0
votes
0answers
62 views

Design of a datamodel in a OO way

I'm looking for some advice how to design a datamodel in OO way (C++ in special). My problem: The user input in runtime is a 1D matrix A = (a0,...,an). The program creates - on the basis of A - ...
0
votes
0answers
74 views

What is the best way to remember a successful execution over several program calls?

I'm working on a build process, that is called manually over the command line. To check if it exited unsuccessfully during the build I want to set a lock file (symbolic link) and remove it on ...
1
vote
1answer
156 views

Is it OK for an interface to only communicate half of how something should work?

I have a service where certain other services can report their status to. By status I don't mean whether they are running or not, but whether they have received data. The point is that other services ...
2
votes
1answer
77 views

Suitable software development method/model for R&D Projects

For Research and Development (R&D) project, what type of software development method / model more applicable/suitable? For example, my recent R&D project has several parameters: Requirement ...
1
vote
1answer
73 views

ADT design choices

How do you go about deciding which of the following two representations (in F# syntax) is the right choice in a particular situation? type Choice = A of string | B of string Or: type ChoiceKind = ...
0
votes
2answers
90 views

Track a series of choices with a single number

I want to track a series of scored questions in a single number (the total score). Is that possible? and how? For example, I have 30 questions with either 3 or 2 choices. For any given question, the ...
30
votes
10answers
10k views

Is catching general exceptions really a bad thing?

I typically agree with most code analysis warnings, and I try to adhere to them. However, I'm having a harder time with this one: CA1031: Do not catch general exception types I understand the ...
4
votes
1answer
70 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 ...
1
vote
1answer
473 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
4answers
412 views

Is it bad to use DI to inject constructor parameters at runtime?

These are two classes, the first one I inject an instance of type IEngine while the second one I inject owner's name, tickets and engine. Version 1: public class Car { public Car(IEngine ...
3
votes
1answer
64 views

Introduce Data Transfer Objects or expose complex data model in REST

We are working on an MVVM application. Jersey (backend) exposing a REST interface and AngularJS (frontend) being the only consumer of this interface. The application uses a complex database model ...
0
votes
1answer
165 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 ...
2
votes
2answers
132 views

Designing a system to archive databases with referential integrity

I have a very large Oracle database, with many many tables and millions of rows. I need to delete some of the rows end-to-end. By end-to-end, I mean, if I want to delete a row from a table then I must ...
6
votes
1answer
163 views

In MVC should a model contain subview models?

Some background: A colleague and myself have different interpretations of MVC which means, given the same problem, we are coming up with radically different solutions. He comes from a Java background ...
1
vote
1answer
124 views

Creating a calendar/planner program. Confused about OO logic?

I'd like to create a piece of software that has the functionality of a common written planner. To do this, it will have a Calendar. When planning the program, I became confused as to how I would ...
2
votes
1answer
420 views

How do you show the exception handler in a class diagram?

I have one exception handler class. I want to show this class in the uml -- class diagram. But, I do not know how to represent relationship between class <X> and exception handler class. How can ...
0
votes
1answer
94 views

Cleanest choice for symmetric operations

I have a need to do some processing from a format A to a format B and from B to A. The job in one direction is very similar to its counterpart. Both formats are represented with an interface Msg. In ...
3
votes
1answer
203 views

How to programmatically connect to a particular PC of unknown IP from a WiFi network?

I want to connect and transfer data between a PC and an Android device both of which are on the same local WiFi network. I cannot use the local IP as such in the code to actually get the connection ...