Questions tagged [design-decisions]

general tips and guidelines for designing better applications, regarding APIs, Architecture and internal structures.

103 questions
3
votes
1 answer

Algorithm to represent Decision tables

What would be the best algorithm to use if you wanted to store Decision tables in code, i've looked at the Adjacency matrix and Binary tree would anyone consider this to be the right direction? What other choices to I have?
driveBy
  • 31
  • 2
3
votes
7 answers

C# byte[] substring? (design)

I'm downloading some files asynchronously into a large byte array, and I have a callback that fires off periodically whenever some data is added to that array. If I want to give developers the ability to use the last chunk of data that was added to…
mpen
  • 237,624
  • 230
  • 766
  • 1,119
3
votes
1 answer

A lambda expression with a statement body cannot be converted to an expression tree

There are several questions on StackOverlow about statement body expressions. I am just wondering why it is not possible to do this in C#? (Where is the complexity why it was not implemented in the compiler?) There is great explanation for…
TN.
  • 17,602
  • 25
  • 84
  • 141
3
votes
6 answers

Primary Keys - Native, Sequence, or GUID keys?

In reading this and this and then reading this (which references the other two ironically) I find myself wondering just how big the discussion of this topic is? I am a SQL Server guy and so I tend to use an Identity that is auto generated in the…
Andrew Siemer
  • 9,982
  • 3
  • 37
  • 61
3
votes
2 answers

What was the design decision for variadic functions needing an array?

I am curious and hopefully someone can shed somelight on this - but why do the C# functions that take 'params' have to be an array? I get that the objects in the parameters list are entered into an array but what if someone wants to create a…
user110714
2
votes
3 answers

Why iterator::end( ) are non-static members and not similar as string::npos?

While iterating through a std::map or std::vector or any container which has iterator in it, is checked against the variable.end() and not something like container<>::end. For example, map var; for(map::iterator it = var.begin();…
iammilind
  • 62,239
  • 27
  • 150
  • 297
2
votes
3 answers

How do I know when to and whether to have a separate controller for a piece of code?

So I am in a situation where I have to decide whether or not to have a separate controller for a particular piece of code. We have a home page that acts like a hub for the rest of the site. The page is accessible to all users (logged in as well as…
Chirantan
  • 14,264
  • 7
  • 45
  • 71
2
votes
1 answer

A wizard's logical behavior

The question I have is about the general functionality of the back button in wizards. I was thinking about the possible behaviors of this button and I couldn't find any clue which one is the right choice between these two options. 1- It should show…
Saffar
  • 510
  • 1
  • 5
  • 12
2
votes
2 answers

Why was getMonth deprecated on java.sql.Date and java.util.Date

I should preface this with I use Apache Spark, which uses java.sql.Date, in case anyone suggests I should use dates from java.time. The example below is in Scala. The API that I use (which is deprecated) to get the month for a date is as…
Nick
  • 630
  • 7
  • 19
2
votes
0 answers

Should I add an optional class member using std::optional or inheritance?

I have class Item, one of no interest itself. However, I need some Items to be gear like clothes or weapons which need to additionally store an enum class Limb object which represents the body part where they can be equipped. Moreover, ordinary…
2
votes
2 answers

Rationale for numpy.split returning a list and not an array?

I was surprised that numpy.split yields a list and not an array. I would have thought it would be better to return an array, since numpy has put a lot of work into making arrays more useful than lists. Can anyone justify numpy returning a list…
kilojoules
  • 7,600
  • 17
  • 63
  • 123
2
votes
2 answers

Azure Apps - Distributed Architecture - 1 API Layer vs 2 API Layers - Design decisions

Background Having run through the Getting started with API Apps and ASP.NET in Azure App Service tutorial (https://azure.microsoft.com/en-gb/documentation/articles/app-service-api-dotnet-get-started/), we had an architecture question arise today…
2
votes
2 answers

Repeated properties design pattern

I have a DownloadManager class that manages multiple DownloadItem objects. Each DownloadItem has events like ProgressChanged and DownloadCompleted. Usually you want to use the same event handler for all download items, so it's a bit annoying to have…
mpen
  • 237,624
  • 230
  • 766
  • 1,119
2
votes
3 answers

Why does window.parent self-reference?

I understand from documentation and several related StackOverflow posts that window.parent, if there is no other parent, will self-reference and thus never be undefined. I can't seem to find a decent reason as to why this is. JavaScript does have…
Cellivar
  • 530
  • 9
  • 27
2
votes
3 answers

Should I use Rails 3 for my application

I have been a user of Rails for a while and used version 2.3.4 recently. Rails 3 Beta just came out recently and it seems have significant performance improvement especially with the merge with Merb. I'm planning on building an application that will…
Tam
  • 11,390
  • 19
  • 65
  • 117