Questions tagged [modules]
Modules are independent software components that result from the decomposition of a larger software into more manageable pieces.
144
questions
0
votes
0
answers
43
views
Split actor model logic into modules
I'm starting a project using .NET and Microsoft Orleans, running on Kubernetes. The main reason I chose Orleans is that I have a system that deals with accounts. There can be millions of accounts, but ...
0
votes
1
answer
98
views
Is it bad practice to export all the names from one module both as named exports and as a default export?
I like to export the names in my modules both as individual named exports and grouped together in a default export. Like this:
// mod.js
export function f() {}
export const x = true
export default {f,...
5
votes
5
answers
2k
views
How to think when grouping functionality into modules
What are some commonly used strategies when it comes to divide software into modules, other than there should not be any cyclic dependency between any modules? Some ways I think of
Group everything ...
2
votes
2
answers
147
views
How to develop a desktop software with components based on several different technologies
If I give a real example, I want to create a desktop software that includes:
electron js app that communicates with react js using IPC channels.
I need to communicate with software that only has a ...
0
votes
1
answer
458
views
What's the best way to import a python module in a python module without cluttering the modules namepace? [closed]
Let's say I am writing a python module module.py. Which provides functionalities for other parts of my code. Of course, the module has to import other modules. A simple example:
import abc as _abc
...
5
votes
1
answer
2k
views
Does a programming language with ML-style modules need packages?
This is a clarification of a closed question. I've limited the scope as requested.
First, a few definitions, following e.g. A modular module system. Consider any programming language with a selected ...
0
votes
1
answer
267
views
Decoupling modules of a monolith
As part of an migration from .NET Framework to .NET Core we're looking to decouple elements of our monolith into more manageable modules. Ideally following a clean architecture/DDD/microservice ...
0
votes
2
answers
104
views
Logical architecture based on modules and SPI
I'm looking for the most proper way to design a modular application with ServiceLoader.
--MAIN IDEA--
module app.view | exports app.view.View interface that defines UI api
module app.engine | exports ...
1
vote
0
answers
98
views
How to structure an ERP system in a modular way, with module hierarchy and where do application layers stand in this?
I built an asset management system (a web application) using C# ASP.NET in MVC structure. My project is built upon the ASP.NET Boilerplate template, which includes 5 layers by default. These layers ...
0
votes
4
answers
285
views
Code for interface and the type erasure problem
As a design priciple I was taught:
Programe para una interfaz, no para una implementación. Es decir, no se deben declarar las variables con el tipo de los herederos sino con el tipo de los supertipos....
2
votes
2
answers
336
views
Modularity vs pure functions
I often come across this dilemma in my own code and wondered if there is a term for this and if there is a single solution to it. Let me illustrate it with a pseudocode example of making a table from ...
1
vote
2
answers
1k
views
Modules Design and Communication Between Them
I'm trying to design a monolithic application following DDD and clean code. Lets say I have Users, User Types, Products, Product Types and Purchases. I want to implement using different modules.
At ...
6
votes
2
answers
226
views
Why does CPython has both C and .python versions of modules?
The CPython implementation seems to have the same modules written both in C (e.g., datetime in .c) and also in .py for the same module (e.g., datetime in .py).
My question is which version is used ...
2
votes
1
answer
1k
views
How to integrate Androidx Paging-3 in Clean Architecture?
This blog on "Clean Architecture" describes how to build a modular Android application along with using Clean Architecture.
In that example project, the author places the business logic in a ...
1
vote
1
answer
670
views
How to define vertical slice in a system whose horizontal slices are defined by Java modules?
For the project I'm working on I was thinking to create a Java Module for each layer of my system:
servlet-presentation defines the implementation of the presentation layer. It is composed by Java ...
2
votes
2
answers
555
views
Design of a modular application
I'm developing an application (Java) in a modular architecture. I have two approaches in mind and I'm not sure which one will be "better code" in case of maintenance and conventions.
I have ...
0
votes
1
answer
34
views
Modularized authentication providers for Spring application
At our company, we have multiple products which share authentication settings. In particular, we use Spring LDAP, but since our use case and configuration is more complex, we would like to use ...
0
votes
2
answers
249
views
How to version modules that depend on different framework versions
I work as a Website developer. We use a framework for building the backend of our sites.
This framework recently released a new major version with lots of breaking changes. We have some sites using ...
3
votes
1
answer
460
views
Shared library and modules with versioning
I have different versions of modules and they should all work together with the same shared library which could also have different versions like displayed in the image below:
From a daily use ...
1
vote
1
answer
3k
views
What is the idiomatic way to split code between separate files in Rust?
Coming from the world of C#, where, despite sharing namespaces, it's quite common for every class to have its own file, I find that Rust codebases seem to have a complete different sort of philosophy (...
0
votes
1
answer
99
views
When and where should I start background services defined in DI modules
We use Dependency Injection extensively using the Ninject library in our .NET based products. Most of our code is neatly packaged in Ninject modules. Some of these modules contain background services ...
1
vote
1
answer
45
views
CLI and Lib package, where to put module loading code
My Software contains a lib package, a cli package and an arbitrary number of plugin packages.
The plugin packages do the algorithmic work.
The lib package basically just executes the plugins and ...
0
votes
2
answers
137
views
What's the pattern to share database to other module in security perspective?
In a large iOS application, I have a database module which is dedicated to handle application databases with read/write public APIs for other module. UI module has a feature to share the database, in ...
-3
votes
1
answer
690
views
What is the rule for making functions private in Python modules?
I was wondering what's the principle behind it, and whether I should treat all functions from module that are not used anywhere else at the time as private, and mark them with underscore prefix so ...
4
votes
4
answers
2k
views
What is module in Software engineering context?
In Software engineering , I usually see that the word module when written it usually followed by a bracket (components, packages, classes … etc.) meaning that a module can be a class or a package or a ...
1
vote
1
answer
223
views
Component based architectures in JS / PHP: what indicators suggest that a UI element ought to be written as an importable component?
N.B. Several months after initially asking this question (and not coming up with any satisfactory answers) I am now learning to use HTML Custom Elements / WebComponents. It seems the same question ...
1
vote
1
answer
127
views
Tips for module naming and criteria for grouping files in a directory
It appeared, that I have in my pet project two abstractions: asset loaders and drawing tasks. For each abstraction I have some classes representing them (currently a single class for drawing task ...
2
votes
2
answers
535
views
How could I reuse common JS modules between several projects?
At my company, we are developing pretty simple React Native and sometimes mobile-only React apps. Most of them have some similar logic, such as 'sign-in by phone' flow, some payments stuff, etc., and ...
23
votes
3
answers
8k
views
Why are module-specific prefixes widely used for function names in C modules?
In some C projects, function names start with a common prefix indicative of the module name, for example:
mymodule_do_this_stuff();
mymodule_do_that_stuff();
Is there a justification for doing so ...
1
vote
0
answers
35
views
How to lay out a core java module with an Android GUI layer on top
How can I use Java modules in an Android app repository? In particular, what directory structure should I use?
I have a project in mind for which I would like to have a GUI-independent core Java 9 ...
-3
votes
1
answer
1k
views
What is informational cohesion?
I try to understand what cohesion means when designing modules. Myers states in his book "Composite structured design":
An informational-strength module has the following definition:
It ...
1
vote
0
answers
69
views
How to organize an App composed of Features in Qt?
When developing a somewhat larger application, with 3-4 screens or so, what is the most common way to organise the code?
I've read that organize-by-feature trumps organize-by-type, so I was ...
0
votes
1
answer
471
views
How to set up import main module while developing a Python package
This is a matter of naming, structuring and conventions.
I am developing a simple python package. in a directory "PKG" I have 3 files:
__init__.py:
# import the main module
import PKG.main
# in ...
2
votes
1
answer
101
views
Transpiling in npm modules
While recently creating a module for shared functionality between our projects I stumbled upon this question. Should the module be occupied with transpilation of code to older browsers that our ...
2
votes
2
answers
292
views
Separating namespaces from files in Python
I'm writing a Python library in which various objects are represented as Python classes. However, the user is not supposed to create instances of those classes directly. Instead, there are a set of ...
2
votes
1
answer
3k
views
Java package naming conventions (in maven modular project)
Until now I have been using simple strategy for packages naming in my maven-modular projects. Each package name contains name of the module in which it is placed.
For example, simple project would ...
2
votes
1
answer
84
views
Design Pattern to implement a settable JavaScript Module variable
I am writing a client to talk to a server API in JavaScript. I have an OOP background but am trying to embrace modern EcmaScript.
So I started with this:
customerApi.js:
const baseUrl = "http://...
0
votes
1
answer
285
views
What was the distinction between module interface files and module implementation files before Oberon?
I'm reading the book "The Go Programming Language" and this sentence in the preface section "The Origins of Go" has me puzzled:
One major stream of influence comes from languages by Niklaus Wirth, ...
0
votes
1
answer
4k
views
How to have parent and child modules in Maven that both package as jar files?
I have an unresolvable dependency issue in a Maven project; different pieces of code depend on different versions of dependency A (i.e. most code needs A:0.15; some needs A:0.18). Fortunately, the ...
1
vote
0
answers
2k
views
Multi module Maven project or separate repositories?
Consider the following architecture:
Application A
Application B
Commons-Util
A and B share a lot of functionality. That's why we plan to extract the shared code into a commons library.
I am aware ...
1
vote
1
answer
419
views
What is it that is so hard about ES6 modules for Node? [closed]
It seems like ES6 imports for Node have been a bugbear for a while. There is the --experimental-modules flag, or options like using Babel - but AFAIK ES6 modules still aren't supported in vanilla Node....
3
votes
1
answer
110
views
Is there a recommended design/architecture when developing a JavaScript module?
Practicing some of the ES7 features, I started developing a class to perform some actions on the DOM and use the new features. I used Babel to make it work on the browser, and the code looks something ...
2
votes
1
answer
1k
views
Private/Hiding dependencies between Maven modules
Given three project modules X, Y and Z on a Maven based project, and Y depends of Z and X of Y and X should not know that Y depends of Z, being this:
X -> Y
Y -> Z
X -X> Z
What is the best way to ...
0
votes
1
answer
186
views
Abstract data communication in modular design
I'm doing the analysis for a software which I've had in mind for a long time. Its purpose is to turn sound into an image, apply graphical transformations on it, and turn it back into sound to hear the ...
1
vote
1
answer
216
views
How to create a framework in Express.js
I'm trying to figure out how to create a Node.js/Express.js application that is a framework for hosting and running third-party code in my application, and what are the appropriate JavaScript/Node/...
3
votes
3
answers
2k
views
Should I divide C++ program into multiple interacting applications?
We are discussing proposal to split a big C++ program into multiple separate executables that would communicated using shared memory. The shared data structures are large, so we do not want to use ...
4
votes
2
answers
3k
views
How does java 9 manage module versions?
I was going through a fantastic talk by Alex and nearly all the things he spoke made sense to me except for the given thing.
Link
In a nutshell how does module manage versions. If I have a module v1 ...
-1
votes
2
answers
69
views
How do I let other developers integrate modules into my content generator?
Background:
I'm building a desktop app where user ability to develop mods is critical. At its bare bones it is a content generator where the content has many layers, and users can develop their own ...
0
votes
1
answer
333
views
What is a good versioning strategy to achieve 'fail fast' with chains of dependent maven submodules?
My organisation modularised their monolith into maven modules in dependencies up to four deep. Originally we used the maven plugin to auto-increment the version numbers in the pom every time someone ...
0
votes
1
answer
757
views
Making an existing project modular
Context:
I have recently joined a new company where they have a particular folder structure in the project where they have different modules in different folders in a single project. Each module ...