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

learn more… | top users | synonyms (1)

3
votes
3answers
913 views

Is it bad practice to make an iterator that is aware of its own end

For some background of why I am asking this question here is an example. In python the method chain chains an arbitrary number of ranges together and makes them into one without making copies. Here is ...
37
votes
6answers
3k 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
4answers
318 views

Dependency inversion always includes dependency injection?

This is a question on a home work. I've been up and down my notes and I can't even see how the two are related. Googling this gives me questions/answers on one or the other, but never both.
1
vote
1answer
285 views

Is Java's ElementCollection Considered a Bad Practice?

From my understanding, an ElementCollection has no primary key, is embedded with the class, and cannot be queried. This sounds pretty hefty, but it allows me the comfort of writing an enum class which ...
2
votes
1answer
99 views

Are post conditions of a routine a subset of precondtions?

Like the title says. The post conditions of a routine must be a subset of the preconditions for the routine? The way I understand post-conditions is that they are entirely independent of ...
0
votes
1answer
98 views

Is creating a separate pool for each individual png image in the same class appropriate?

I'm still possibly a little green about object-pooling, and I want to make sure something like this is a sound design pattern before really embarking upon it. Take the following code (which uses the ...
1
vote
1answer
54 views

Advice on designing a robust program to handle a large library of meta-information & programs

So this might be overly vague, but here it is anyway I'm not really looking for a specific answer, but rather general design principles or direction towards resources that deal with problems like ...
7
votes
3answers
214 views

What are common patterns for handling possible pluralization in message properties?

Obviously users like to see text properly pluralized, and pluralization schemes vary in the various written languages one may encounter. When internationalizing an app, what pattern(s) are useful for ...
4
votes
4answers
285 views

Should single purpose utility app use a class

When writing a small utility app, that does just one thing, should that one thing be encapsulated in a seperate class, or just let it be part of whatever class/module is used to start the application? ...
3
votes
2answers
215 views

Semantic coupling vs. large class

I have hardware I communicate with via TCP. This hardware accepts ~40 different commands/requests with about 20 different responses. I've created a HardwareProxy class which has a TcpClient to send ...
1
vote
3answers
2k views

Has anyone used “Design Pattern Framework (TM)”? [closed]

Has anyone purchased Design Pattern FrameworkTM? Are these samples worth investment? Are they practical? What are the pro and cons of the guidelines? Anyone used this in the real-world development?
13
votes
2answers
593 views

“Do it right, against customer's wishes” - how is it called? [closed]

We know the optimal situation of negotiating corrections of specifications with the customer, getting the specs to do what the client wanted, not what they said or thought they wanted. That's ...
10
votes
4answers
631 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 ...
3
votes
3answers
527 views

How bad is it to have two methods with the same name but different signatures in two classes?

I have a design problem related to a public interface, the names of methods, and the understanding of my API and code. I have two classes like this: class A: ... function collision(self): ...
15
votes
4answers
1k views

Why many designs ignore normalization in RDBMS?

I got to see many designs that normalization wasn't the first consideration in decision making phase. In many cases those designs included more than 30 columns, and the main approach was "to put ...
60
votes
15answers
9k 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 ...
4
votes
1answer
903 views

Functional/nonfunctional requirements VS design ideas

Problem domain Functional requirements defines what a system does. Non-Functional requirements defines quality attributes of what the system does as a whole.(performance, security, reliability, ...
19
votes
6answers
1k views

Is an event loop just a for/while loop with optimized polling?

I'm trying to understand what an event loop is. Often the explanation is that in the event loop, you do something until you're notified that an event occurred. You than handle the event and continue ...
-1
votes
3answers
2k views

Browser-based GUI for a python application [closed]

I want to create a web/browser-based GUI for a command-line python application. The goal is to make use of HTML/JS technologies to create this GUI. As the application itself, it needs to run on Linux ...
0
votes
1answer
241 views

how to improve design ability [closed]

I recently went on a couple of interviews and all of them asked a one or two design questions, like how you would design a chess, monopoly, and so on. I didn't do good on those since I am a college ...
3
votes
5answers
459 views

Requring static class setter to be called before constructor, bad design?

I have a class, say Foo, and every instance of Foo will need and contain the same List object, myList. Since every class instance will share the same List Object, I thought it would be good to make ...
2
votes
1answer
134 views

Data Transformation Pipeline

I have create some kind of data pipeline to transform coordinate data into more useful information. Here is the shell of pipeline: public class PositionPipeline { protected ...
0
votes
1answer
198 views

The balance between client and server functionality

I want to bring the discussion that started in our teams and get your opinion about it. Assume we have an user account which could have different credentials for authentication and associated email ...
5
votes
2answers
346 views

Buzzword for “performance-aware” software development

There seems to be an overabundance of buzzwords for software development styles and methodologies: Agile development, extreme programming, test-driven development, etc... well, is there any sort of ...
13
votes
5answers
10k views

Fastest way to document software architecture and design [closed]

We are a small team of 5 developers and I'm looking for some great advices about how to document the software architecture and design. I'm going for the sweet spot, where the time invested pays off. I ...
5
votes
4answers
219 views

Get Info From Database, or Build Inferred Info?

Does it make more sense to store and retrieve properties or information directly related to an item in a database, or, say in such a case that a product's ID could describe information about it, ...
0
votes
2answers
182 views

Subclassing to avoid line length

The standard line length of code is 80 characters per line. This is accepted and followed by the most of programmers. I working on a state machine of a character and is necessary for me follow this ...
4
votes
2answers
264 views

Permissions and MVC

I’m in the progress of developing a web application. This web application is mostly a CRUD interface, although some users are only allowed to perform some actions and see only some parts of views. ...
0
votes
4answers
1k views

What is the difference between WCF service and a simple Web service in developing using .NET Framework?

My questions are: What is the difference between WCF service and a simple Web service in .NET Framework? What a WCF Service can do which a .NET Web service cant? In other words, what are the ...
5
votes
4answers
443 views

How do I decide to which class a method should belong

I have TopicBusiness.class and PostBusiness.class. I have no problem with deciding into which class methods such as addPostToDatabase() or getAllPostsFromDatabase() should go. But what about ...
2
votes
2answers
86 views

Designing a user-defined list to be stored in a relational database - Should I include user index?

By index, I mean, as the user creates the list, each item receives an integer index for its place in that particular list. Since there will be a table of ListItems, I'd prefer to avoid using the name ...
2
votes
5answers
163 views

Designing a single look up entity

In almost every application you have this look up entity that provides a dynamic references. This are things like type, category, etc. These entities will always have id, name, desc So at first I ...
2
votes
4answers
138 views

How to handle status columns in designing tables

How to handle multiple statuses for a table entry, for example an item table may have an active, inactive, fast moving, and/or batch statuses. And I wanted to handle them in single column with VARCHAR ...
9
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
vote
2answers
345 views

Should I close database connections after use in PHP?

I wonder if I should close any unnecessary database connection inside of my PHP scripts. I am aware of the fact that database connections are closed implicitly when the block stops executing and ...
0
votes
0answers
18 views

Rails: The Law of Demeter [duplicate]

I am reading a book called Rails AntiPatterns and they talk about using delegation to to avoid breaking the Law of Demeter. Here is their prime example: They believe that calling something like this ...
16
votes
13answers
656 views

Design for future changes or solve the problem at hand

While writing the code or during design do you try to generalize the problem at the first instance itself or try to solve that very specific problem. I am asking this because, trying to generalize the ...
1
vote
1answer
274 views

Applying DDD principles in a RESTish web service

I am developing an RESTish web service. I think I got the idea of the difference between aggregation and composition. Aggregation does not enforce lifecycle/scope on the objects it references. ...
6
votes
2answers
653 views

Is programming in layers real? [duplicate]

I am fairly new in product development and I am trying to work over a product. The problem that I have realized is that people draw diagrams and charts showing different modules and layers. But as I ...
6
votes
4answers
512 views

Rails: Law of Demeter Confusion

I am reading a book called Rails AntiPatterns and they talk about using delegation to to avoid breaking the Law of Demeter. Here is their prime example: They believe that calling something like this ...
1
vote
1answer
165 views

clone/copy constructor and child class

I just want feedback on what one considers 'most elegant design' for a situation like this. I have an object that is immutable with some (sort of) copy constructors to allow creating a similar but ...
2
votes
1answer
212 views

Rails: Useful example of delegate and Law of Demeter

I am currently learning about delegate and the Law of Demeter. I understand the Law of Demeter, but I can't seem to find a good example of where using delegate to avoid breaking the law would actually ...
8
votes
3answers
918 views

Why was Android's ContentProvider created?

The title sums up my question, but to elaborate basically what I want to understand is why the Android designers want apps that need to work with shared data to use a Content Provider rather than just ...
1
vote
2answers
542 views

business logic: client-side vs. server side

Let's say 3-5 years ago (more or less) n-tier application on the server side - and some javascript/html/CSS for the UI was a basic approach for web development. Nowadays we can see that traditional ...
2
votes
1answer
312 views

Should we create classes just to group properties

I am designing a bit of software that will integrate with our enterprise system using web services. We are dealing with work orders that are needed to maintain equipment. We have a bit of a ...
1
vote
3answers
336 views

Is it bad practice to check object types with an identifying member variable?

Preamble: I am making a simple board game in C++, in which AI characters move around squares on the board. There are different types of squares, each inherited from an abstract class, each with ...
0
votes
1answer
3k views

Why would one prefer C# (ASP.NET MVC) or Java (JSP) instead of PHP for web applications/projects [closed]

I'm wondering, why would one (consider it not just a single developer, but a company) prefer C# or Java for web applications? What's their considerations regarding the question. I mean, a company, has ...
6
votes
2answers
379 views

Module system for OOP language

I'm designing a simple OO programming language. It's statically typed, compiled, and executed by a VM - similar to Java. The difference is that I don't want to have such a strong emphasis on OOP. ...
0
votes
1answer
136 views

In an optimal software design, would you ever need to throw InvalidOperationException?

.NET defines the InvalidOperationException as The exception that is thrown when a method call is invalid for the object's current state. In an optimal software design, would it ever make sense ...
0
votes
1answer
81 views

Choosing which application instance will do the updates when dealing with multiple workstations w/o server involved?

So, I've got an interesting design problem and I honestly don't know how to tackle this. I have an application that will be ran on a dozen of workstations. Of those workstations, it is impossible to ...