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

learn more… | top users | synonyms (1)

7
votes
2answers
312 views

Dependency Inversion Principle: Understanding how both low level components and high level components depend on abstractions

I'm learning about the Dependency Inversion Principle. It states that: High level modules should not depend upon low-level modules. Both should depend upon abstractions. For a while I tried to ...
0
votes
3answers
82 views

Should I use an Exception in a case like this? [duplicate]

I have a Windows service with a fluent interface like this: aRequest = Repository.getRequest() .createProcess() .validate(); Sometimes getRequest() could ...
6
votes
5answers
558 views

Object model design: collections on classes

Consider Train.Passengers, what type would you use for Passengers where passengers are not supposed to be added or removed by the consuming code? I'm using .NET Framework, so this discussion would ...
4
votes
3answers
218 views

Help with design structure choice: Using classes or library of functions

So I have GUI Class that will call another class called ImageProcessor that contains a bunch functions that will perform image processing algorithms like edgeDetection, gaussianblur, contourfinding, ...
3
votes
2answers
389 views

Aren't decorators easily breaking the ISP?

"The Interface-Segregation Principle (ISP) states that no client should be forced to depend on methods it does not use." The decorator pattern is a design pattern to decorate a method of a class. For ...
0
votes
1answer
112 views

Is it better to pass the whole object or use a setter?

Here is my initial code that I would like to modify by using strategy design pattern. class Bar { int a; int b; ... } Class Foo { Bar *bar; bool action1(){ // this function does a ...
70
votes
15answers
11k 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 ...
1
vote
4answers
504 views

Is it considered 'reasonable' to implement a major part of a program largely by subclassing a library class? [closed]

I'm planning to implement a word processor using Java, and Swing for the GUI. I was thinking how I can implement the text area where the user types the text. My idea was to subclass JTextArea. It ...
0
votes
1answer
144 views

UML class diagram - instantiation dependency relationship: who depends on who? [duplicate]

I did some reading on the <<instantiate>> relationship in UML class diagrams. It's a dependency relationship where one side depends on the other. However, I'm not sure who depends on who: ...
0
votes
3answers
167 views

Design and relationship of a cursor and its referred object

I need to implement a Cursor class to perform operations on a Document object, which is implemented internally as a simple list of rows. The Cursor class must have methods such as moving around the ...
1
vote
4answers
285 views

Why do browsers these days ship with dev tools [closed]

I just read a question asking how Facebook blocks console-based script attacks. The reason for this block was to prevent a recently famous "hack" where one would trick a user to inject a malicious ...
13
votes
3answers
642 views

Why are interfaces more helpful than superclasses in achieving loose coupling?

(For the purpose of this question, when I say 'interface' I mean the language construct interface, and not an 'interface' in the other sense of the word, i.e. the public methods a class offers the ...
2
votes
1answer
553 views

Can Objective C categories serve the same purpose as Traits do in Scala?

The statement of the question seems little abstract to me, so please read the details below. Since the time when C++ was the first choice Object Oriented Language for almost anything, we had a big ...
0
votes
3answers
151 views

New and old technologies coexist in legacy system [closed]

New technologies can accomplish existing tasks in more efficient and powerful way. But sometimes old technologies cannot be discarded unfortunately, so more numbers of technologies in one system make ...
20
votes
6answers
3k views

What is the role of the lead developer in an agile team?

In a non-agile development team a lead developer generally: Sets the standard (coding and otherwise) Researches new technologies for the team Sets the technical direction for the team Has the final ...
2
votes
3answers
958 views

Class Design and Separation Of Concerns

I'm working on an MVC application and am wondering about the best way to design one of my models. I have a class called RightLeftPersonToggle which represents two select list boxes on the page. The ...
1
vote
5answers
631 views

How do I deal with global variables in existing legacy code (or, what's better, global hell or pattern hell)?

So... We have this fairly complex project (~10k LOC, but there's duplicated code so it's hard to tell) with hundreds of global variables. The project has more dependencies on other projects, and many ...
2
votes
2answers
196 views

How to provide a service with RESTful API?

Generally speaking, RESTful API's are very good for representing resources and collections of resources. http://example.com/resources http://example.com/resources/item17 And we are good, if we ...
4
votes
6answers
335 views

Depending on fixed version of a library and ignore its updates

I was talking to a technical boss yesterday. Its about a project in C++ that depends on opencv and he wanted to include a specific opencv version into the svn and keep using this version ignoring any ...
4
votes
6answers
1k views

How does rapid prototyping fit into an agile methodology?

I work for a large company, which dictates the use of agile processes. For example, for our projects, we use cloud-based services that are specifically targeted at managing agile development. The ...
0
votes
3answers
453 views

Design for multiple type return

I am working in C++ and I have this problem. class Container { Container(int which_type_to_use_a_b_or_c); A & getData(A & prototype); B & getData(B & prototype); C & ...
0
votes
2answers
91 views

Multi-Branch Retail System,how to control items quantity for various branches? [closed]

Currently I am developing Multi-Branch Retail software. All branches have the same set of items. However, each one has its own stock quantity. My question is, what is the best practice to apply in ...
0
votes
3answers
72 views

How to design routes for generalized/specialized resources

I hope I can explain what is troubling me. Example: I have an object basket with a list of fruit objects. So normally I would build my routes like this baskets/{basketId}/fruits/{fruitId). But fruit ...
1
vote
1answer
135 views

How to implement an algorithm out-of-core?

I want to implement a parallel clustering algorithm "out-of-core" in CUDA. My CPU has 12GB of RAM and GPU has 4GB of it. What I want is that the entire dataset should be on the disk, and I can pick ...
0
votes
3answers
133 views

What goes within the Architecture Overview of a Design Specification?

I have designed an management system for a medical practice and I am writing the design specification and I am kind of stumped by what to write for a section. It asks for me to write about the ...
1
vote
1answer
118 views

Advantages and disadvantages of making one DB per customer [duplicate]

I'm starting to design a web application, and I'm evaluating some decisions regarding the general structure of it. My use case is as follows: I plan to have multiple customers on a single server. ...
2
votes
2answers
163 views

MVC: “User” model gets big and crowded. Should methods that do CRUD operations on one-to-many relationship data be in different models?

In most MVC web projects there is a User class. Many times a user has something else in a one-to-many relationship, i.e. orders. If we have a user class that has many orders, should methods that add, ...
0
votes
1answer
90 views

Performance of One API vs Multiple API's

I was having a conversation with a colleague and although my opinion makes sense to me, I wasn't able to back it up. I'm in the process of creating an API that will be hit hundreds of thousands of ...
0
votes
2answers
213 views

Can this argument be enough?

We have two C++ classes named Important and Small The class Small use a few methods and attributes from the class Important, but not all. Since our application is performance critical, instead of ...
0
votes
0answers
40 views

Sproc chaining verse discrete calls from OO code

I'm currently working on a change at work to generalize a function that was sloppily coded up to work for a particular use case. The function calls a particular sproc that checks if an entity exists ...
2
votes
1answer
210 views

Inventory Management System Design Problem “Items Packages”

I am developing a retail management system with inventory management module, I am facing a logic design problem and I don't really know how to address the problem in an easy way, so I wrote an example ...
3
votes
1answer
188 views

OO design choice and single responsibility principle

I'm currently refactoring an application which periodically downloads content from various sources (http, ftp, sql, etc). There is a schedule which controls the times during which the application can ...
0
votes
0answers
54 views

Suggestion to Design API Centric Application using Appengine

I have been planning to create an new application. So I was designing the application structure.i know this application will be accessed form multiple devices and the app feature will be increased. ...
2
votes
2answers
131 views

Refactoring sought for replacing shared data types in .NET component

I am in charge with updating a software product that is made up of two components the Controller process and the UI process. The Controller and the UI communicate via XML messages. Furthermore, the ...
1
vote
2answers
189 views

Using the Decorator pattern to add public methods to an object

The Decorator pattern is usually used to extend the functionality of an object by extending one of it's current methods. To illustrate, please consider an object object and a decorator decorator. ...
2
votes
0answers
74 views

What are some important considerations when developing a DBaaS (DataBase as a Service)

I'm interested in creating a Database as a Service. I want users of the service to be able to do a few seemingly not very simple things. Sign up and be given access to a JSON datastore that they can ...
2
votes
4answers
223 views

Should refactoring be the exception or the rule? [closed]

I had a discussion with a co-worker yesterday about design philosophy. The other coder is more experienced then me, and I fully admit that he is likely much better at properly automating his testing, ...
-1
votes
2answers
122 views

Design suggestion required to create an Export plugin

I am trying to create Export Module for our application, this seems to me a bit complex so I am posting it here to get some guide lines. In our database we have a list of Products, which can be ...
0
votes
0answers
25 views

Communication between resource and authorization server/identity manager?

Short Doing the design / for an api we're building we noticed there is little to nothing to be found on how your resource server can validate a token given by a client with the ...
0
votes
1answer
137 views

Singleton: Why is a global point of access bad? [duplicate]

Most people here and on StackOverflow agree that Singletons are evil. The main explanation I've come across against the use of Singletons, is they fact that they provide a global point of access to ...
0
votes
1answer
47 views

Automating form error handling

I'm not sure if I'm being clever or making things more difficult. I'm working within a custom MVC framework, and within some of my "views" which contain forms I'm preserving input and styling errors ...
1
vote
4answers
309 views

Wrapper around C++ STL

Where I work we have our own system library, which pretty much is only wrappers around the STL, such as: template <typename T> class HVector { protected: std::vector<T> data; public: ...
2
votes
3answers
475 views

Empty virtual method on base class VS abstract methods

I couldn't find a question that was not too specific to some case, so I'll try to make this very generic. We need an extractor base class to a set of documents, for example. Each document has its ...
1
vote
3answers
322 views

PHP Code base design: Single “queries.php” file, or spread queries across different php files/classes?

When I create PHP projects, is it better to put all database (e.g. MySql) queries in a single file (i.e. "queries.php")? Or is it better to place the respective queries in any "model" classes (i.e. ...
0
votes
1answer
128 views

Why can't the Factory Method pattern create a family of objects? [duplicate]

There are two main differences between the design patterns Factory Method and Abstract Factory. Difference 1 is that Factory Method is mainly based on inheritance. A class in a way uses it's subclass ...
2
votes
3answers
237 views

How does Observer create loosely-coupled design?

I completely understand the Observer design pattern, what it is for and how to implement it. I also understand what the term 'loosely-coupled' means. But I'm not sure how Observer makes designs more ...
0
votes
1answer
177 views

Observer pattern: “Web of observers” - Is this ever in use?

I had an idea (which I'm sure already exists), to create a sort of 'network of observers/subjects'. I would like to describe how it works and than ask several questions about it. Say we have 5 ...
-3
votes
1answer
65 views

For professional designing company, what is the key to design an app elegantly? [closed]

I am coding and found it's pretty hard to come up with an elegant design for my app at the first attempt. First time I'm only about 40% happy, then I refactor it to code the same app a second time ...
0
votes
0answers
45 views

Is having coupled hosting in one platform better than having decoupled hosting?

Recently I have been thinking of converting some ideas into apps with couple of like minded friends. Our app will have an module, where users must include an instant messaging. The requirement for ...
0
votes
0answers
50 views

How to store progress of abstract events?

I making a game in node.js. I have players and they can perform a lot of actions. Actions are all coded as functions, and they change certain variables in either User object or other objects that ...