The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
298 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
157 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
562 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
4answers
2k 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
509 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 ...
12
votes
4answers
948 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 ...
4
votes
2answers
684 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
3answers
952 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
151 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
125 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
876 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
67 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
329 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 { ...
9
votes
4answers
8k 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
512 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 ...
6
votes
5answers
3k 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
827 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
1k 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
194 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 ...
6
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 ...
51
votes
2answers
5k 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
1answer
148 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 ...
2
votes
3answers
205 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 ...
8
votes
7answers
743 views

Is it appropriate for a class to only be a collection of information with no logic?

Say I have a class Person that has instance variables age, weight, and height, and another class Fruit that has instance variables sugarContent and texture. The Person class has no methods save ...
-2
votes
2answers
130 views

Software patterns for frameworks [closed]

I am currently doing some research about software patterns and about architectural patterns for frameworks specifically. Google is not really showing off for this topic, so I am curious which ...
2
votes
2answers
671 views

How Visual Studio could help to avoid duplicating code?

I work within a team of developers. Everyone is making their changes without carrying too much if the same thing is already implemented in the codebase. This leads to classes constantly growing and to ...
13
votes
1answer
2k views

How to choose between using a Domain Event, or letting the application layer orchestrate everything

I'm setting my first steps into domain driven design, bought the blue book and all, and I find myself seeing three ways to implement a certain solution. For the record: I'm not using CQRS or Event ...
3
votes
6answers
3k views

Which order to define getters and setters in? [closed]

Is there a best practice for the order to define getters and setters in? There seems to be two practices: getter/setter pairs first getters, then setters (or the other way around) To illuminate ...
9
votes
8answers
657 views

When does 'optimizing code' == 'structuring data'?

A recent article by ycombinator lists a comment with principles of a great programmer. #7. Good programmer: I optimize code. Better programmer: I structure data. Best programmer: What's the ...
22
votes
4answers
3k views

Is “convention over configuration” not violating basic programming principles?

I was looking at the WPF MVVM framework Caliburn.Micro and read that a lot of standard things are based on naming conventions. For example, automatic binding of properties in the View to properties ...
2
votes
2answers
312 views

Best approach for utility class library using Visual Studio

I have a collection of classes that I commonly (but not always) use when developing WPF applications. The trouble I have is that if I want to use only a subset of the classes, I have three options: ...
5
votes
2answers
745 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
2answers
284 views

Pattern(s) about hierarchical settings overwriting

Assume that you have a hierarchy of organizational units: - Company -- Branches --- Departments ---- Teams Lets say I have some settings (for simplicity assume that they have the same properties) ...
7
votes
2answers
3k views

Storing and maintaining serialized objects in C#

What are the best practices to store and maintain serialized objects in C#? Any strategies or patterns that apply? What I have come to believe so far is this: Prefer Json over XML, both for space ...
5
votes
6answers
466 views

What are best practices when switching between projects/coming back to projects frequently?

The nature of my job is that I have to switch back and forth between projects every few weeks. I find that one of the biggest impediments to my productivity is the ramp-up time to getting all the ...
8
votes
2answers
262 views

Low coupling processing big quantities of data

Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure ...
3
votes
1answer
99 views

Rpc transferring data or Replication

I have services on 10 machines that stores data in database on these machines. And I have main server that needs to pull that data from these ten machines. What is better for this. Implement some rpc ...
6
votes
4answers
675 views

Should injecting dependencies be done in the ctor or per method?

Consider: public class CtorInjectionExample { public CtorInjectionExample(ISomeRepository SomeRepositoryIn, IOtherRepository OtherRepositoryIn) { this._someRepository = ...
1
vote
1answer
309 views

What is the “Find-Fix-Verify” pattern?

What is the "Find-Fix-Verify" pattern, as related to the process of doing editing/spellchecking/debugging, etc.? Where is this pattern best described? What are some advantages and disadvantages of ...
1
vote
1answer
2k views

How frequent should the Token Updation in CSRF security be?

To start with the background, this post is what Jeff Atwood says about CSRF tokens. In this very page, he goes on to say: An even stronger, albeit more complex, prevention method is to leverage ...
2
votes
3answers
159 views

Alternate approaches to creating custom forms in a web application

We are putting together some distribution software, selling about 150K SKU's. Some of our items have additional requirements in order to be sold that are dictated by our vendors. For instance one type ...
10
votes
3answers
2k views

What is the pattern name for using method chaining to build an object?

I frequently use a pattern where I using method chaining to setup an object, similar to a Builder or Prototype pattern, but not creating new objects with each method call, instead modifying the ...
1
vote
1answer
106 views

How to prevent corrupting an hierarchical XML tree?

We have an XML tree which stores the relationship between folders and video files. So each folder could be the artists name and below it we have the videos of the artist. Also each folder can have ...
13
votes
2answers
1k views

Is using the new System.Tuple class bad design?

I like the concept of System.Tuple in that it allows me to return multiple parameters in a single function call without instantiating a new class, however does this defy any good programming practices ...
4
votes
1answer
174 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 ...
32
votes
4answers
9k 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 ...
2
votes
2answers
459 views

Legal Applications of Metamorphic Code

Firstly, I would like to state that I already understand the 'vx' applications for Metamorphic code. I am not here to ask a question related to any of those topics as that would be inappropriate in ...
2
votes
1answer
395 views

prism and multiple screens

OK - I am studying Prism a little because of a "free weekend" offer on Pluralsight. As this is proving too complex for me, I went to the Prism book and looked at the forward, and this is what it said: ...
10
votes
9answers
1k views

Is this an anti-pattern?

I've seen this a lot in our legacy system at work - functions that go something like this: bool todo = false; if(cond1) { ... // lots of code here if(cond2) todo = true; ... // some other ...
5
votes
1answer
124 views

Checking members and instantiating in properties

Consider this: public MyClass { private Resource _myResource; public Resource MyResource { get { if(_myResource == null) { ...