Tagged Questions
The patterns-and-practices tag has no wiki summary.
-6
votes
0answers
55 views
Summarized explanation of Scrum? [closed]
I've noticed this word used ( Scrum ) which I think refers to a project management practice.
What is a general summary of Scrum?
0
votes
0answers
27 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 ...
33
votes
10answers
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 ...
0
votes
0answers
46 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 ...
0
votes
3answers
117 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 ...
0
votes
1answer
95 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
495 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 ...
0
votes
0answers
39 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 ...
12
votes
4answers
647 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 ...
0
votes
3answers
163 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
250 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
877 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 ...
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
109 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
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 ...
2
votes
3answers
194 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
163 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
304 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
298 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
207 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 ...
1
vote
1answer
200 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
439 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 ...
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 ...
1
vote
1answer
205 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 ...
0
votes
1answer
123 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 ...
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
295 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) )
{
...
0
votes
0answers
149 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 ...
8
votes
3answers
535 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 ...
4
votes
3answers
794 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 ...
2
votes
1answer
408 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
673 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 ...
5
votes
2answers
650 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
570 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
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 ...
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 ...
8
votes
5answers
589 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 ...
0
votes
1answer
63 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, ...
3
votes
1answer
286 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
{
...
7
votes
4answers
4k views
Is it a good practice to create a ClassCollection of another Class?
Lets says I have a Carclass:
public class Car
{
public string Engine { get; set; }
public string Seat { get; set; }
public string Tires { get; set; }
}
Lets say we're making a system ...
1
vote
1answer
433 views
Which practice is the best for database connection? (PHP, etc)
Leave a open database connection throughout the execution of the aplication, or for each time a operation will be executed a new connection will be created?
Open throughout the execution:
Open ...
5
votes
5answers
2k views
Database connection - should they be passed as parameter?
We have a system whereby the database connection is get once using a common method, and being pass throughout the relevant class to be used. There are doubts that passing the database connection as a ...
2
votes
4answers
688 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
908 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 ...
6
votes
3answers
186 views
Holding mutable data in a single place
Given a mutable property, it generally makes sense to only hold/store that property in a single place. When the data needs to change you only need to update a single field, and you can completely ...
5
votes
2answers
1k views
When is Efferent / Afferent coupling good or bad
I have a software patterns exam this week and one of the topics we are to study is Efferent and Afferent coupling.
I understand a package has a high Ce (efferent coupling) if it depends on a number ...
48
votes
2answers
4k views
+150
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
1answer
134 views
Design patterns to avoiding breaking the SRP while performing heavy data logging
A class that performs both computations and data logging seems to have at least two responsibilities. Given a system for which the specifications require heavy data logging, what kind of design ...