Questions tagged [design-decisions]

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

93 questions
0
votes
0 answers

Why comparing an Integer object with a primitive int throws null pointer exception when the Integer object is null in Java

Why does the code below throw null pointer exception? I would expect the equivalence to be simply false. Can someone explain what happens under the hood and the reason for this design decision? Integer i = null; System.out.println(i == 10); //…
CEGRD
  • 7,787
  • 5
  • 25
  • 35
0
votes
1 answer

What is the best way to validate if a value with decimals is in a defined range

I have a file with thresholds defined and these threshold are use to help to take decision. The values looks like this: "thresholds":[ { "min": 0.0, "max": 0.25, "text": "VERY UNLIKELY" }, { "min": 0.26, "max": 0.50, "text": "UNLIKELY" } …
Jonathan Anctil
  • 1,025
  • 3
  • 20
  • 44
0
votes
1 answer

Multi Tenant vs Single Tenant?

I am about to build a SAAS product using Rail and Postgres. I would like to know if I should follow schema level, sub-domain based multi tenancy or a single tenant application is good enough Architecture? My requirement has no dependability of data…
Shazad Maved
  • 235
  • 1
  • 5
  • 12
0
votes
2 answers

New to java stuck on Decision Making in java

I have created a class named Bicycle now I want to limit the gear of my bicycle to 6. A value greater than 6 will give an error and message will be displayed: System.out.println "Error...!! Please enter a number between 1-6". Can someone tell me…
Sayury
  • 25
  • 5
0
votes
0 answers

Programming languages where indexing starts at 1?

Possible Duplicate: List of 1-indexed programming languages? Besides AWK, are there other programming languages where indexing starts at 1 instead of 0?
helpermethod
  • 59,493
  • 71
  • 188
  • 276
0
votes
1 answer

CSS code structure decision

I'm currently working on an header for some website. This header consists of two different designs: Floating/horizontal header: +-------------------------------------------------------------------------+ | +--------------+ …
user6105890
0
votes
1 answer

Why can't you create a setter without getter in scala?

I found in Scala: can't write setter without getter? that you can't create a setter without getter: The interpretation of an assignment to a simple variable x = e depends on the definition of x. If x denotes a mutable variable, then the…
Rik Schaaf
  • 1,101
  • 2
  • 11
  • 30
0
votes
2 answers

Which db should I choose for my transaction logging

I have a database question. I am developing an application where users sends some request and gets an answer from a vendor. I have a server receiving the request (through a rest call or a running web service, haven't decided which yet). Whenever a…
PNS
  • 750
  • 1
  • 5
  • 19
0
votes
3 answers

Tough inheritance database/model design decision

I have Users which can be either TypeS, TypeC, or TypeA. I have models for each of these types to store additional information. Now, in the Users table, should I have 3 nullable foreign-key fields to designate which type they are 2 fields, 1 with…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
0
votes
7 answers

Is it ever useful to have reference type declared as const?

Why would someone ever do: const object useless = null; const IEnumerable meaningless = null; Eric Lippert says features are unimplemented by default and every possibility adds more effort in testing, maintaining etc... Why would a null value for a…
nawfal
  • 70,104
  • 56
  • 326
  • 368
0
votes
1 answer

Omitting the virtual destructor when the only derived class adds no extra variables

I have a class Literal which is really just a wrapper for (const int). I want to have a second class PositiveLiteral which inherits from Literal, but has a constructor that asserts that its value is positive. class Literal { public: Literal(int…
dspyz
  • 5,280
  • 2
  • 25
  • 63
0
votes
1 answer

Best way to store course notes / medium sized text digitally - Must be: efficient, easy to display on web, flexible

I am building my personal web site and I want to store my course notes on it. My course notes are currently on paper so I will be typing them up. I am thinking about storing each of my courses in its own XML file with a structure that goes like: The…
0
votes
2 answers

Javascript - Distance (in pixels) - Decision

I have a simple javascript animation, where two cowboys (iamges) 'race' each other based on a random interval number. What I can't find out how to do is for the script to take a decision on who is the winner, meaning if a cowboy reaches a…
Brian
  • 1,951
  • 16
  • 56
  • 101
0
votes
7 answers

What should be the expected behavior on this user decision?

I have this application where the users can change text files and when they forget to save them, a little message pops up reminding them that the changes are not saved and asks them if they want to save the changes or not with two buttons "Yes" and…
rfgamaral
  • 16,546
  • 57
  • 163
  • 275
0
votes
1 answer

Database schema for multiple checkboxes

I currently have a Users table and now want to add other user-related information for a particular user. The form that accepts this information has fields like languages and OS each with a list of options with checkboxes. For Example: Languages…
Mark
  • 883
  • 1
  • 8
  • 14