The tag has no wiki summary.

learn more… | top users | synonyms

13
votes
4answers
727 views

Is it bad practice to allow user defined fields?

Generally speaking, is it considered bad practice to allow for user created fields in a database for a webapp? For example, I am making a home inventory webapp for my wife, and she is going to want ...
4
votes
4answers
960 views

Exceptions vs ErrorCodes when working with devices

Out team is at the cusp of a new project. One of the components at the boundary of the system is the component which interacts with a printer through an external COM component (referenced as a usual ...
35
votes
11answers
4k views

Are error variables an anti-pattern or good design?

In order to handle several possible errors that shouldn't halt execution, I have an error variable that clients can check and use to throw exceptions. Is this an Anti-Pattern? Is there a better way to ...
49
votes
2answers
4k views

Are there any OO-principles that are practically applicable for Javascript?

Javascript is a prototype-based object oriented language but can become class-based in a variety of ways, either by: Writing the functions to be used as classes by yourself Use a nifty class system ...
0
votes
0answers
28 views

update methods in simple factories

I have simple factory class with differently named methods which create the same object but differently. These created objects are persisted to db. These are then retrieved from the db elsewhere and ...
0
votes
0answers
48 views

How to cleanly write a multi step process with user feedback and multiple callback

When you have some process that has several steps and you multiple entry points the code gets ugly pretty fast. I encountered this with Facebook integration in my mobile app: User wants to share ...
3
votes
3answers
4k views

Should angularjs directive directly interact with services or is it considered an anti-pattern?

Which one is considered better: having a directive that interacts with services directly or having a directive that exposes certain hooks to which controller may bind behaviour (involving ...
0
votes
3answers
118 views

One method with many behaviours or many methods

This question is quite general and not related to a specific language, but more to coding best practices. Recently, I've been developing a feature for my app that is requested in many cases with ...
2
votes
4answers
705 views

Best practice to sync long paths to filesystems where path length is limited?

I wrote a sync tool to synchronize folders/files from Alfresco to Windows. PROBLEM: In Alfresco, /files/can/have/very/very/very/long/filepaths/like/this.txt The Windows API prevents me from creating ...
0
votes
2answers
935 views

How to implement a hybrid role-based access control model?

I am writing an enterprise web-forms-frontend application for in-house use. It has Direct access control (DAC) masquerading as Role-based access control (RBAC). For anonymization purposes, let's ...
0
votes
1answer
109 views

Using a progress dialog and multi threading

My .NET Windows desktop application creates an HTML report, and has 3 main phases. It may create multiple reports. I show a progress bar so the user knows (estimates) how long it will take (as well ...
0
votes
3answers
520 views

How can I explain this is an anti-pattern? [closed]

I recently started at a new job. The existing system works OK but is poorly designed and hard to maintain, and they are planning to rebuild it in MVC and I fear it will be much worse. (Not because ...
31
votes
4answers
8k views

Developing a feature which sole purpose to be taken out?

What is the name of the pattern in which individual contributors (programmers/designers) developed an artifact for the sole purpose is to serve as a diversion so that management can remove that ...
0
votes
0answers
40 views

What should I do with too much interfaces needed for a dialog

Let me start by doing a small summary of the changes we did in our code in the last year. We have a software (VERY big) that is used to visualize multiples underground networks, enter data in the ...
14
votes
5answers
1k views

Combining getters and setters

JavaScript libraries such as jQuery, combine 'getters' and 'setters' in the programming interface for example: $('element').css({'color','blue'}); will set the color or $('element').css(); ...
0
votes
3answers
169 views

“Property Container” design-pattern in-depth definition

Could anybody, please, explain what is a Property Container or at least where can I get information about that pattern on the Internet? I've found that it exists as one of the Fundamental patterns in ...
0
votes
0answers
29 views

DSL enabling users to reference forms and records to display?

There are three main "unique" components to my system: Visual form builder (AngularJS backed); generates an id CRUD automatically available for it at /form_type/id "Aggregate page"; with a form ...
0
votes
5answers
279 views

Is it a good practice to wrap collection in Java? [closed]

I came across a snippet like this, and find it's over engineering. Is it a good practice? public class SchoolList extends ArrayList<School> { } public class School extends ...
4
votes
2answers
883 views

When is it worthwhile to replace working mature code with frameworks+patterns

I fear that frameworks in many cases have become a fashion or trend and are being abused. In many ways people are sacrificing speed just because they want to keep up with every single lib that comes ...
16
votes
4answers
2k views

What is “lambda” code?

I have recently heard people talk about code being "lambda". I have never heard of this phrase before. What does it mean?
6
votes
1answer
103 views

Dangers when implementing features as plugins [closed]

What kind of problems have you encountered when building plugin interfaces for your application? And how did you resolve them? Background I want to refactor an application so that various features ...
0
votes
2answers
111 views

How does one design his various architecture/business models?

I'm currently learning about various application design approaches and there's one thing I can't really get my head around. Let's say I have a physical device in my network, an IP surveillance ...
2
votes
3answers
201 views

What is a good use case for native XML databases? [closed]

What would be a good use case to use a native XML database such as Apache Xindice and eXist-db? I have used XML features of SQL Server in the past and they were of great value, but there it is ...
3
votes
2answers
167 views

How to abstract transition between Views?

Our team is developing an application using WPF with MVVM. We want to make ViewModels reusable. With this intention we want to abstract the transition logic between Views (ViewModels, we use ...
5
votes
4answers
307 views

Is it normal to write all logs into a single file?

Our teamlead said that many files much worse than a single, despite of we are working on a big project. He argued that our customers could more easily send logs to us if there will be just a single ...
6
votes
4answers
577 views

Structured code vs Duplicate code. Modifiability [duplicate]

I have noticed that my classmates write unstructured code with a lot of duplication. And their solutions of the same tasks often contains more then three times more lines than my project. But when ...
-1
votes
1answer
302 views

Are verb-like classes a code smell? [closed]

I do a lot of flat-file processing to extract data. The file "formats" are very unique and each file format requires a lot of format-specific code. Sometimes, the parsing code needs to maintain a lot ...
5
votes
3answers
239 views

How to represent (enum) types in a public API

I am working on a simple API that I want to use for my own client, and to open to the public in the future. I have "Item" objects which can have different "types". The type is a C "typedef enum", for ...
5
votes
2answers
645 views

Returning an IQueryable from an IRepository

Using the Repository pattern, is it proper to return an IQueryable of a data set (table), for generic usage? It is very handy in many cases, especially when using external libraries that leverage ...
1
vote
1answer
217 views

Javascript heavy page/application - best practice for handling errors

Consider an application that contains a number of pages with a relatively large amount of javascript present, or a predominantly JS powered application. The script handles a number things, such as: ...
8
votes
2answers
445 views

Is implementing an interface defined in a subpackage an anti-pattern?

Let's say I have the following: package me.my.pkg; public interface Something { /* ... couple of methods go here ... */ } and: package me.my; import me.my.pkg.Something; public class SomeClass ...
1
vote
1answer
208 views

Unit-testing databases: test all possible permutations of read and write to table?

I am testing a resource management class that is interacting with a database or a file system, or a combination of both. I was wandering if it is the norm to test all possible permutations of read and ...
3
votes
3answers
490 views

Why is quantity in software still written as “1 result(s)”?

Lately, I've been noticing that a lot of software, be it a website, a client application, or a video game, often write a representation of quantity as follows: "1 result(s)". Now, I can understand why ...
0
votes
1answer
124 views

Datastructure for a factory pattern in practice

I'm implementing what's basically an event log system for a larger system. I used Single-table inheritance to build out the table. The problem I'm having is figuring out how to build out the classes ...
0
votes
1answer
149 views

Truth condition testing with BOOL

BOOL myBool; myBool = YES; ... if (myBool) { doFoo(); } I have read that because there are instances where the above does not actually call the doFoo() function, it is best to instead always test ...
3
votes
1answer
170 views

Naming a sending/receiving module. Does the pattern have a name? [closed]

I'm working on a simple piece of functionality (actually a ruby gem, but that is beside the point) which can be used to receive and persist incoming messages send and persist outgoing messages ...
3
votes
1answer
296 views

What is the pattern called when getters take responsibility for the setting?

I've been heavily using a pattern for years now, but I don't know what it's called. It looks like this.... class xzy { public function getFoo() { if ( undefined(this.foo) ) { ...
4
votes
1answer
166 views

Rapid code analysis

I have recently moved to a new company where I am tasked (in part) with evaluating the existing code base and coming up with patterns and best practices. Our development team consists of around 20 ...
0
votes
0answers
153 views

Pattern or solution for using classes with different interface the same way

What I would like to achieve is to use classes (now two, later more) with different interface the same way, so I would like avoid using decisions based on the interface on upper levels for instance, I ...
6
votes
4answers
754 views

How does one learn to program (and think) the Ruby way? [closed]

Why I Ask this Question: I've just starting to learn Ruby (and by extension IronRuby since I work in the Microsoft world). I picked up IronRuby Unleased to teach me the basic syntax of Ruby, and any ...
8
votes
3answers
540 views

How to migrate my thinking from C++ to C#

I am an experienced C++ developer, I know the language in great details and have used some of its specific features intensively. Also, I know principles of OOD and design patterns. I am now learning ...
2
votes
1answer
422 views

Modern practices for stored procedure-based applications

I work in a fairly large and old solution that has many entry points for different kinds of clients, with web sites for public access, web sites for internal access, some web sites and web services ...
11
votes
4answers
709 views

When and for what purposes should the const keyword be used in C for variables?

While getting my code reviewed here the issue of using the const keyword came up. I understand that it is used for implementing read-only behaviour on variables. I am confused about what are the ...
8
votes
5answers
627 views

Designing a robust architecture for multiple export types?

I'm looking for patterns or architectural guidance for an upcoming feature I'm designing. Basically, it's an export feature with multiple export targets, and I'm looking to find a way to make it ...
5
votes
2answers
653 views

Is sticking to one language on a particular project a good practice?

I'm developing a pipeline for processing text that will go into production. The question I keep asking myself is: should I stick to one language for the project when I'm looking for a tool to do a ...
3
votes
2answers
603 views

What is the middleware pattern?

Here's a Ruby poject that implements the middleware pattern. From the description, I have no idea what the pattern is, what it's useful for, and why other solutions wouldn't work as well. What is ...
0
votes
1answer
120 views

Architecture for writing add-ins for closed-source software

currently I'm designing an add-in for the modelling tool Enterprise Architect. The general architecture is shown in the picture below. Basically every action where the add-in can react to is ...
0
votes
1answer
64 views

How to record/store edits?

In many programs and web apps (stack exchange included) the program is able to backtrack what edits where made to the piece. My issue is similar: I want to be able to store a "timeline" of edits, ...
2
votes
3answers
195 views

Is there some software to manage a XP Project? [closed]

I was wondering if there's some software to manage a XP project. I'm starting a school project and I want to follow this methodology, but, we don't have a place to work. Each one works at home (in ...
3
votes
1answer
290 views

Reading from a file and inserting into a database, a good practice

I am making an Android application which reads several JSON files and inserts the read information into tables in my database. For instance, there are three files: countries.json { ...