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

learn more… | top users | synonyms (1)

2
votes
2answers
688 views

What's the best practice for async APIs that return futures on Scala?

I have started a project to write an async PostgreSQL driver on Scala and to be async, I need to accept callbacks and use futures, but then accepting a callback and a future makes the code cumbersome ...
2
votes
2answers
327 views

Is Multithreading Appropriate for Setting up Multiple Windows in the Same Application?

I am currently working with a Qt Application which tries to use multi threading to accomplish two task To Prevent the Main Thread's Event Loop from being blocked To increase computation efficiency ...
4
votes
3answers
982 views

Is it a bad practice to use inline styling with generated code?

If I'm using a technology like Grails. It's really easy to wind up with inline styling. Are there any downsides to auto-generating code with inline styling? Is this considered bad practice? Why?
10
votes
2answers
9k views

What is a recommended pattern for REST endpoints planning for foresighted changes

Trying to design an API for external applications with foresight for change isn't easy, but a little thought up front can make life easier later on. I'm trying to establish a scheme that will support ...
2
votes
2answers
192 views

Methods of ordering function definitions in code

When I work on some programming project (usually command line application in Python with many switches), I'm usually creating about 30 and more functions. Most of the functions are in one file (except ...
4
votes
1answer
157 views

What criteria could be used to rank popular blog posts?

I am building a service that finds popular posts from several blogs. What criteria could I use to define what the most popular posts are? For example, I track Facebook and Twitter share counts for ...
5
votes
4answers
1k views

Where to define view-specific data objects in Rails

Background: there are several places in our app where we want to display date-oriented information on a calendar. The event_calendar gem looks nice and has lots of reviews, so it's what I'm planning ...
3
votes
2answers
1k views

What is the relationship between the business logic layer and the data access layer?

I'm working on an MVC-ish app (I'm not very experienced with MVC, hence the "-ish"). My model and data access layer are hard to test because they're very tightly coupled, so I'm trying to uncouple ...
2
votes
3answers
3k views

Exporting huge data into XLS in a web application

I am developing a web application in Java/J2EE, in which I have export functionality. I have used Jasper for the same. The issue is when trying to export a huge set of data it is consuming a lot of ...
1
vote
1answer
355 views

Is Rule 9 of Object Calisthenics applicable in Objective C?

Rule 9 in Object Calisthenics by Jeff Bay (RTF) is: Rule 9: No getters/setters/properties The last sentence of the previous rule leads almost directly to this rule. If your objects are now ...
6
votes
4answers
276 views

Communications regarding maintainability of code

I'm in search of good language or metaphors to discuss the maintainability of code with non-technical folks (PMs, business sponsors &c). In particular, I've recently created a few one-off, ...
13
votes
7answers
461 views

How does one decide if a data object type should be designed to be immutable?

I love the immutable "pattern" because of its strengths, and in the past I have found it beneficial to design systems with immutable data types (some, most or even all). Often when I do so, I find ...
5
votes
4answers
252 views

Users creating instances from a template - is there a software pattern that corresponds to this use case?

I am looking into designing a system where users build a template item and then create many instances based on this template.They then need to be able customise each instance but I also need for them ...
0
votes
2answers
459 views

Is this bad design for a Shape interface?

I'm creating a vector editing program in C++, and I need a Shape interface which other concrete classes will implement. There is a requirement that no implementation inheritance is allowed. The design ...
6
votes
3answers
159 views

Grouping conceptual algorithms into one class or associate with their object models

If I have a number of classes, lets say a variety of buildings of some sort. Each of these buildings have various properties and do some stuff etc Now there is a set of operations I need to do on ...
4
votes
2answers
128 views

Maintaining Organization When Designing Software

I've been trying for years to come up with a good way to organize the massive amounts of notes and material I generate when designing, coding, and testing software. My desk is usually overflowing with ...
3
votes
3answers
280 views

Designing access to file-based “database”

It happened frequently that I have to provide access to a bunch of files organized in a directory tree according to some (sometimes loosely specified) rules. My standard pattern is to provide a ...
3
votes
2answers
184 views

In Functional Programming, should domain-relevant simple functions (e.g., sorts) be reified?

In a functional application, should you wrap common higher-level functions in domain-meaningful names or should you leave them "bare"? For instance, if you have a list of Addresses, and "sorted by ...
0
votes
2answers
212 views

Windows OS design decisions [closed]

I've seen an interview with Richard Stallman some time ago, and he was asked a question about security and Windows OS which he answered saying that there are some relatively bad design decisions that ...
12
votes
3answers
2k views

What are the best resources for learning about concurrency and multi-threaded applications?

I realised I have a massive knowledge gap when it comes to multi-threaded applications and concurrent programming. I've covered some basics in the past, but most of it seems to be gone from my mind, ...
3
votes
2answers
895 views

Databinding to an Entity Framework in WPF

Is it good to use databinding to Entity Framework's Entity in WPF? I created a singleton entity framework context: To have only one connection and it won't open and close all the time. So I can ...
2
votes
1answer
119 views

Need help with clarifying the design of an Android game

I'm going to develop a Kakuro (Cross-Sums) game for Android, and have got the algorithm right. But I can't seem to get the user-interaction part right- i.e. The puzzle is very large. So only a ...
8
votes
5answers
2k views

Interface and Inheritance: Best of both worlds?

I 'discovered' interfaces and I started to love them. The beauty of an interface is that it is a contract, and any object that fulfills that contract can be used wherever that interface is required. ...
21
votes
9answers
2k views

Should a view and a model communicate or not?

According to the wikipedia page for the MVC architecture, the view is free to be notified by the model, and is also free to query the model about its current state. However, according to Paul ...
3
votes
2answers
542 views

Organizing MVC entities communication

I have the following situation. Imagine you have a MainWindow object who is layouting two different widgets, ListWidget and DisplayWidget. ListWidget is populated with data from the disk. ...
10
votes
4answers
5k views

The term “interface” in C++

Java makes a clear distinction between class and interface. (I believe C# does also, but I have no experience with it). When writing C++ however there is no language enforced distinction between class ...
-1
votes
1answer
565 views

How to design classes in right way (sending messages)

Trying to design small project in right way and have a trouble in it:\ about task: need to realize multiplication of big numbers, using fft First, i have classes class LargeNumber{}; class Field{}; ...
21
votes
5answers
4k views

Is is preferable to design top down or bottom up?

As I understand, top-down design is by refining the abstract high level concept into smaller concrete and comprehensible parts, until the smallest building block is defined. On the other hand, bottom ...
5
votes
1answer
1k views

Designing a scalable and robust retry mechanism

Backstory I have an Messaging Server Application that is responsible for brokering/proxying calls made from an Application Tier to numerous external services. The purpose of this application is to ...
1
vote
2answers
545 views

How should I handle multi-tasking in a WPF application?

In most of the multi-tasking CRM applications I've seen, MdiWindow is used to allow users to open multiple windows at the same time. But MdiWindow doesn't seem to be commonly used in WPF. Looking ...
2
votes
1answer
868 views

When using Java Persistence API (JPA), which layer owns the entities?

When working with annotations on entities in JPA, do these entities belong to the model layer or the persistence layer? Does there have to be some kind of clone of the entities (simple JavaBeans) in ...
6
votes
5answers
697 views

Best-practice to manage concurrency into a basket in a e-commerce website

What is the best practice to manage the case where two customers add in the same time a product whose the stock was only 1 ? Must there be a check in the code of the basket to avoid one of these 2 ...
1
vote
1answer
300 views

Need suggestion for Mutiple Windows application design

This was previously posted in StackOverflow, I just moved to here... I am using VS2008, MVVM, WPF, Prism to make a mutiple window CRM Application. I am using MidWinow in my MainWindow, I want Any ...
6
votes
1answer
381 views

Refactoring an existing MVC codebase to remove business logic & data access from the Controllers

Product I've inherited has the following composition: MVC web site where the controllers make calls to Repositories to get, insert and update objects retrieved that are defined in the: Data ...
5
votes
2answers
165 views

API design involving standard and custom settings

Suppose a class allows some kind of configuration that has some well-known default values but also has the option of defining a custom value. For example, suppose you want to let users configure a ...
9
votes
5answers
593 views

Writing Testable Code vs Avoiding Speculative Generality

I was reading some blog posts this morning, and stumbled across this one: If the only class that ever implements the Customer interface is CustomerImpl, you don't really have polymorphism and ...
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. ...
14
votes
7answers
527 views

Are there general rules or best practices for building a new framework?

I need to start the design and development of a new framework to interact with an open source ECM. This inludes a customized data model to help web site developers interacting with this ECM, so they ...
29
votes
8answers
2k views

S.O.L.I.D., avoiding anemic domains, dependency injection?

Although this could be a programming language agnostic question, I'm interested in answers targeting the .NET ecosystem. This is the scenario: suppose we need to develop a simple console application ...
9
votes
4answers
610 views

What's wrong in returning hashtable from public method and when does it make sense to do so?

What are the design problems in returning a hashtable from a public method when you want to return multiple items instead of creating a class and returning object of that? If it does have problems ...
8
votes
4answers
3k views

How did you get good practices for your OOP designs?

I realized I have a difficulty creating OOP designs. I spent many time deciding if this property is correctly set it to X class. For example, this is a post which has a few days: ...
10
votes
4answers
650 views

Should we rename overloaded methods?

Assume an interface containing these methods : Car find(long id); List<Car> find(String model); Is it better to rename them like this? Car findById(long id); List findByModel(String ...
7
votes
3answers
9k views

PHP web application architecture/design [closed]

I've been thrown head-first into a new job developing web applications in PHP. I'm by no means new to PHP, but I haven't developed large-scale applications before. I'm wondering how to structure my ...
6
votes
4answers
701 views

Object-oriented design question

I am using a class through a dll to which I do not have direct control. So in effect, I am only a client of this class. The class represents a form that can be printed, sent to clients and tracked ...
19
votes
6answers
17k views

Difference between a service class and a Helper class

I would like to know what differentiates a Service class from a utility class or a helper class? A class only with underlying methods calls the dao's is a service? Doesn't the usage of Helper ...
6
votes
1answer
702 views

How do you perform modeling in an Extreme Programming environment?

I know methodologies, like Extreme Programming (XP), which specifies its own specific practices for developing software. However, unlike Scrum where it focuses more on management aspects, XP specifies ...
7
votes
5answers
278 views

Should an application be designed without prototyping first?

I've just begun using a popular, well-documented graphics engine, and was given a month to create some small programs and get familiar with it. The library is huge, and there are sections I haven't ...
8
votes
3answers
3k views

Functional Programming approach for a simplified game using Scala and LWJGL

I, a Java imperative programmer, would like to understand how to generate a simple version of Space Invaders based on Functional Programming design principles (in particular Referential Transparency). ...
1
vote
3answers
625 views

I feel I'm a good junior programmer, but how to become a good programmer who writes beautiful code? [closed]

As a beginner, I can say that in about six months I grasped very well many basic programming concepts. I began with php, then wen to c, then to java, and I know quite well the procedural and the ...
5
votes
7answers
288 views

What should be the “depth of design”? [closed]

We all know that the process of creating a design and the whole architecture of the software is very important before writing the code. But how deep should be dive into the design stuff - should we ...