0

The examples of default settings:

  • Default port for server applications
  • Default resources directory for Java Applications
  • Default Webpack config file ("webpack.config.js")

My particular case

I have a utility for web application projects building, based on gulp and webpack.

enter image description here

When a user did not specify some settings in config file of his project (similar to pom.xml, webpack.config.js, etc.) DefaultSettings will be substituted. The example of default settings for markup preprocessing:

{
  indentationSpacesCountInOutputCode: 2,
  mustExecuteHTML5_Validation: true,
  mustExecuteCodeQualityInspection: true,
  mustExecuteAccessibilityInspection: true
}

Maybe I can call it "the business rules", but it including, for example, the paths which must not be watched for browser live reloading providing for specific framework:

{
  laravelBasedProjectRelativePathsWhichWillBeWatched: {
    includedDirectoriesRelativePaths: [
      "app",
      "bootstrap",
      "config",
      "database",
      "public",
      "resources",
      "routes",
      "storage",
      "tests"
    ]
  }
}

In Clean Architecture, the business rules must not know anything about frameworks.
And also, I need to put somewhere the default settings for specific utilities (e. g. Webpack).

The InternalSettings (I call them so because user can not override it) are currently restrictions of my library, for example, supported file names extensions:

export default {
  supportedSourceFileNameExtensionsWithoutDots: [ "mjs", "js", "ts" ],
  supportedOutputFileNameExtensionsWithoutDots: [ "js" ]
};

I am not sure I can call it "business rules".

If default and internal settings are not the business rules, what are they?

  • These don't go to the rules of the most businesses, industries, companies, unless the domain of the business is IT itself. – Erik Eidt Oct 19 at 15:20
2

A Default value is a piece of Business Logic.

  1. Kevin takes an order to photocopy a sheet of paper
  2. Kevin goes to the printer
  3. Kevin sees that the piece of paper is A4
  4. The customer did not specify the size of the photocopy
  5. Kevin deduces from this lack of information, and the original being sized at A4 that the copy should be A4
  6. Kevin selects the A4 Copy option
  7. Kevin finalises the transaction withthe3 customer.

There is a piece of Business Logic for making a photocopy (step 6). But the size of paper is deduced by another piece of Business Logic (step 5, with input on step 3/4).

In this case the Default Setting was a dynamic calculation. But it could easily be that the business rule is always use A4, even when copying A3/A2/A1 unless told otherwise.

The Business Rules are higher level statements like: When photo-copying copy to the size of paper the customer asked for, otherwise to the same size as the copied page.

| improve this answer | |
1

Should default settings be considered as business rules [...]

There are many posts explaning what business rules are exactly, but in the simplest definition I'd say business rules are the reason the application exists. Without business rules, there wouldn't be a need to create a program.

Business rules can have defaults, meaning if the user interface allows the end user to omit certain details, the program will use default values provided by the business.

If default and internal settings are not the business rules, what are they?

Technical settings like mentioned in the question, are required to make the application run, but they have nothing to do with actual business rules. An acceptable term would be Application configuration settings.

These kinds of settings are not provided by the business, but by the programmer working on the application.

| improve this answer | |
  • Thank you for the answer! I'll consider the "Application configuration settings" term usage. But here is the one problem: how to distinguish the config defined by application developer and config defined by application user? – Tokugawa Takesi YD Oct 24 at 2:42
  • If with config defined by application user you mean the default values provided by the business, those should be codified in a named concept. A constant in the class that uses the default Value is a good place. By nature these business rules don’t change very often, so usually it’s not necessary to change them in runtime. – Rik D Oct 24 at 14:00
  • If there is a requirement to be able to change some default Business value, I would store it in a database and create a UI so the end user can change it. – Rik D Oct 24 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.