naming – How to name a domain concept when experts use different terms?

The DDD literature is quite clear that when a word/term has a different meaning for different users, a Bounded Context should be created to be able to separate the domain models.

I’m facing the situation where two different terms are being used to describe the same concept and I’m having a hard time figuring out how to handle this situation. Should I hold a popular vote among the domain experts to pick the most widely used term? Should we discuss it further and come up with a third name that would satisfy everyone (not sure it’s possible)? Any other suggestions?

Note that in the UI it wouldn’t be so hard to show the ‘correct’ term to the users. I’m mainly talking about how to call the concept in the model and source code.

Some context:

Organisation has two existing off the shelf applications. Application A calls a concept Foo and application B calls the same concept Bar. Both applications have API’s and I’m creating an integration application that allows users to get and manipulate data from both applications.

Application A is the source, when a new Foo is created, my application will create a new thing. Application B also reacts to the creation of Foo and my application will use data from B as well. Various users will work with the thing, until the process is complete and the thing will dissapear. My application will be used by users who work with Application A or Application B.

naming convention – Proper name for reference tables in OLTP

I know this might be a silly question. But I really appreciate accepting and answering this question.

When I have an OLTP database with some big tables like orders and items. I have other tables (similar to dimension tables in OLAP) where we store reference values, such as: currency, city, category.

What is the proper name for those reference tables? Can we still call them dimension tables in OLTP or do they have their own generic name?

java – Naming conventions for classes that technically could/should have the same name

Sometimes such classes would be named as Base- or Core- to indicate that they are to be extended in other implementations, so you’d have CoreBoard and CorePiece.

Depending on the language you’re using, you could also use namespaces to distinguish between the two sets of classes. You could have a namespace for the Engine, and other namespaces for specific implementations. For example: jaylawl.games.engine.Board for the Engine’s Board, and jaylawl.games.chess.Board for your Chess board.

Personally, I prefer the second option, but that may be language-specific.

java – Spring boot, n-tier layer structure naming conventions

I am currently developing a huge project in my company with N-Tier Layer architecture using spring boot but I can not sure about the package and class namings. In our project, we have a complex structure. For example, we have to call oracle plsql procedure/function, pure sql, jpa with basic jpa repositories, web services calls(soap/rest) because of the requirements. For example;

I have to call procedure/function/pure sql with RestTemplate
I have to call rest web services with again RestTemplate
What is the best approach for naming the returning results, classes?

When a client calls a web service in our project, we decided to name the request XRequest, later we map the request objects to the XInput(it contains headers etc.) object with our necessary parameters and passed them to the service layers.

In the service layers, we call necessary other layers.

In these layers, after calling the other layers and returning the results, the procedure call, we map it to the XOutput in the Service Layer with required parameters, we passed XOutput to the Controller Layer, and the Controller Layer map the results to the XResponse objects with the required parameters.

enter image description here

In the above sample structure, what is the best approach of the returning objects’ naming in the Web service/custom repositories. What is the naming of the Class naming(such as Custom Repositories, DaoFactory etc.). What should the naming of the web service call returning objects?

To sum up, in this kind of unstructured project, what is the best approach to the naming conventions of the classes and packages.

Function naming: choosing the order of nouns / verbs in the name

I’m sometimes torn between two naming conventions defining the order of words that make up a function name. The first one is choosing the words in the same order we would natural use in a sentence, for example:

getFilters(...)
getPairedFilters(...)
getUniquePairedFilters(...)

This reads rather naturally but it’s not immediately obvious that all of those functions return filters. Only the last part of the function name indicates that. If the name is long, that’s not as convenient as the following:

getFilters(...)
getFiltersPaired(...)
getFiltersPairedUnique(...)

This, however, does not read as naturally but the names immediately suggest that they all return filters. Is there some sort of a consensus what name ordering is “better”?

naming – How should I name a function that may execute part of its code randomly?

Problem

I have this piece of JavaScript code that is involved in procedurally generating a platformer level:

function placeJumpBlock() {
    if (randomInt(15) == 1) {
        // 1 in 15 chance to generate a jump block
        this.setTile(tiles.jumpBlockActive, x, 0.5 * NY - 4)
    }

    fillBricksBelow()
}

This code is called further on in this way:

if (randomInt(20) == 1) {
    // 5% chance for a column
    placeColumn()
} else if (randomInt(10) == 1) {
    // 10% chance for a bush
    placeBush()
} else if (randomInt(10) != 1) {
    // 90% chance to not place any obstacle
    placeJumpBlock()
} else {
    x += 2
}

Note that while the call to fillBricksBelow in the first snippet and the other place* functions in the second snippet always do what they should with 100% certainty inside the function body, the jump block tile in placeJumpBlock is generated at random, with 1 in 15 chance. What could be a more suitable name for placeJumpBlock?

What I think sounds similar

How to name a method which may or may not perform an action depending on a condition?

Note that the question discusses about naming a function which does something given a condition which most probably has 100% certainty at the function call site, such as passing a Boolean argument to the function, which may not be associated with (pseudo)random chance.

Code from

https://gitlab.com/Vivraan/mario50-pixijs, my own repo.

(I could also use some comments on the code logic, but that’s not my question per se.)

coding style – Standarized prefixes for naming REST POJO (Correct or not correct)?

We are building a software application for a client with a particular naming convention for REST services.

For example if you use a POJO for your request or response in a REST service something like that:

public class Document {
    private String codeDocument;
    private String codeParentDocument;
    private Double amountPayed;
    private String nameOwner;
    private String descriptionDocument;
}

Your REST contract should be so:

{
  "codDocument": "123",
  "codParentDocument": "123",
  "amtPayed": 25.5,
  "desDocument": "owner"
}

This is an example because there a list of many prefixes. This prefixes are used by the organization as convention for its database fields.

I think They want to have some type of homologation between its REST contract and its tables. Another reason could be the fact REST contract in some occasions has many fields and it could cause confusion. Therefore prefix would help to people to distinguish the meaning of a particular field among of many other fields. They could know if a field is a description, amount, code, etc…

But…I recognize that in some occasions this prefix are redundant. For example codeDocument could be simply code. Another example is with DNI (Identity National Document). It should be defined as dni but people from client prefer to use numberDni. DNI is a number, is redundant put the word “number” before…

Another minor problem is many applications from the client use this standard. We would be the only one with get out from the their standards.

I consider that use prefix is not correct but I would like have other opinions and if possible more arguments to convince to my client of my project. Thanks a lot (Y)

What are the best domain in local Active Directory naming practices?

What are the best domain in local Active Directory naming practices? Best option is ad.domain.com or maybe .local is better?
What’s your opinion?

Naming of Monte Carlo and Las Vegas Complexity classes

For Curiosity Sake, I was wondering if there was some history behind the naming of “Las Vegas” and “Monte Carlo” classes.

I’ve searched on the internet for quite some time now but I did not find a proper answer, is it just because they are probabilistic which gives them the “gambling” nature, or is there something more to the nomenclature?

Erro ao tentar executar projeto React Native jest-haste-map: Haste module naming collision: mobile

Estou tentando executar meu projeto em meu dispositivo mobile e esta dando o seguinte erro abaixo, referente a duplicação de arquivos.

    jest-haste-map: Haste module naming collision: mobile
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>mobilepackage.json
    * <rootDir>package.json

Failed to construct transformer:  DuplicateError: Duplicated files or mocks. Please check the console for more info
    at setModule (C:curso-rocketbootcamp-nivel-01_node-js_react-js_react-native_typescriptmobilenode_modulesmetronode_modulesjest-haste-mapbuildindex.js:620:17)
    at workerReply (C:curso-rocketbootcamp-nivel-01_node-js_react-js_react-native_typescriptmobilenode_modulesmetronode_modulesjest-haste-mapbuildindex.js:691:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 1) {
  mockPath1: 'mobile\package.json',
  mockPath2: 'package.json'
}
Error: Duplicated files or mocks. Please check the console for more info
    at setModule (C:curso-rocketbootcamp-nivel-01_node-js_react-js_react-native_typescriptmobilenode_modulesmetronode_modulesjest-haste-mapbuildindex.js:620:17)
    at workerReply (C:curso-rocketbootcamp-nivel-01_node-js_react-js_react-native_typescriptmobilenode_modulesmetronode_modulesjest-haste-mapbuildindex.js:691:9)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 1)