Couplage faible et cohésion forte
- Le couplage mesure l’interdépendance entre classes/modules.
- La cohésion mesure combien les éléments (champs, méthodes, fonctions) d’une classe/module coopère.
Le pire dans le monde : les frameworks
Désolé de faire de la mauvaise pub pour le framework Angular. L’utilisation d’un framework est un couplage fort avec ce framework qui agit comme une prison.
Expérience personnelle :
- J’ai écrit il y a 10 ans une application pour enseigner la logique modale. Le framework était super. Tout mon programme avait un couplage fort avec Angular.
- Il y a un mois j’ai mis à jour Angular… le vieux projet ne compile plus…
- Je réécris tout ?
- Ajouter une fonctionnalité me demande de dépendre encore plus d’Angular ?
(node:1336531) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:1336531) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:1336531) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:1336531) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:1336531) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:1336531) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
(node:1336531) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
10% building 4/5 modules 1 active ...ld_better/old_hintikkasworld/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/es5-polyfills.jsnode:internal/crypto/hash:103
this[kHandle] = new _Hash(algorithm, xofLen, algorithmId, getHashCache());
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:103:19)
at Object.createHash (node:crypto:145:10)
at module.exports (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModule.js:412:16)
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModule.js:444:10
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModule.js:320:13
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/loader-runner/lib/LoaderRunner.js:203:19
at VirtualFileSystemDecorator.readFile (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:46:13)
at processResource (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/loader-runner/lib/LoaderRunner.js:202:11)
at iteratePitchingLoaders (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/loader-runner/lib/LoaderRunner.js:158:10)
at runLoaders (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/loader-runner/lib/LoaderRunner.js:365:2)
at NormalModule.doBuild (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModule.js:292:3)
at NormalModule.build (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModule.js:438:15)
at Compilation.buildModule (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/Compilation.js:702:10)
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/Compilation.js:944:14
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModuleFactory.js:409:6
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModuleFactory.js:155:13
at AsyncSeriesWaterfallHook.eval [as callAsync] (eval at create (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesWaterfallHook.lazyCompileHook (/home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/tapable/lib/Hook.js:154:20)
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModuleFactory.js:138:29
at /home/fschwarz/github/hintikkasworld_better/old_hintikkasworld/node_modules/webpack/lib/NormalModuleFactory.js:346:9
at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
opensslErrorStack: [
'error:03000086:digital envelope routines::initialization error',
'error:0308010C:digital envelope routines::unsupported'
],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v24.11.0