Questions tagged [modules]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

Better way to define & load custom modules?

I have a project that would benefit from having a module folder where classes can be dropped in and automatically loaded. Thus, I have: . ├── main.py └── modules ├── __init__.py ├── one.py ...
0
votes
1answer
28 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
1answer
31 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
2answers
89 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
1answer
51 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 ...
0
votes
0answers
87 views

Aggregate small spring-boot REST services into a big one as dependencies

I have build several small REST services based on spring-boot. Each of this REST service has an own database, own configuration and can run independently without the other services. Each service is ...
4
votes
4answers
250 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
1answer
92 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
1answer
51 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
0answers
52 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 ...
24
votes
3answers
6k 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
0answers
20 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 ...
-4
votes
1answer
342 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
0answers
26 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
1answer
54 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 ...
1
vote
1answer
53 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
2answers
104 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 ...
1
vote
1answer
1k 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
1answer
66 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
1answer
134 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
1answer
1k 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
0answers
734 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
1answer
322 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
1answer
93 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 ...
1
vote
1answer
649 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
1answer
99 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
1answer
164 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
3answers
1k 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 ...
3
votes
2answers
2k 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
2answers
66 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
1answer
253 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
1answer
557 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 ...
0
votes
3answers
490 views

Same JavaScript on different web pages

I have a web site with several web pages. Each page requires some JavaScript: i.e. different JavaScript for different pages, which some JavaScript that's common to every page. Some of the JavaScript ...
-2
votes
6answers
4k views

C++ namespace name isolation

It's been considered for a reason, that using for namespaces/names is side-effect-prone, and generally, fully qualified names should be preferred. I've come up with an approach on that, which I ...
1
vote
2answers
152 views

What is the name of the interface-implementation pattern applied to modularisation?

At work we have a project where we're pushing pieces of the monolith into modules. (A java project making smaller maven modules that we pull in via maven dependencies). The pattern we're using pushes ...
3
votes
0answers
364 views

Perfect video processing pipeline?

I'm working on a modular video processing pipeline. It's currently presented as a tree of modules. Each module has a set of "results" and can dynamically request data results from other modules. Each ...
1
vote
1answer
69 views

KPI Module structure

My plan's to develop a module for easy customer KPI handling across projects. It should consist of a small SDK to put 2-3 lines of code in the project, a "template"/model for a SQL table (code first ...
2
votes
1answer
72 views

Convention where to place unexportable functions

For the example's sake let's say there is a given file math.js. Think of it as a module containing many reusable functions. The content of file is: export function area(shape) { normalize(shape) ...
25
votes
2answers
55k views

Classes vs. modules in Python

Python has many modules (such as re) that perform a specific set of actions. You can call the functions of this module and get results, and the module as a whole has an idea behind it (in this case, ...
1
vote
1answer
634 views

Class vs Module - When classes are needed to be in module?

I am developing an application that has a lot of options like local database CRUD operations, file IO, web APIs calling, notifications, user preference settings, services, widgets etc. At start it ...
1
vote
0answers
78 views

SonarQube Recommends Unsynchronized Class

I adopt a software architecture where I have one single data access in the persistence layer. Indeed, the persistence layer is a mere java application (JAR file) that I consider as an dependency, ...
0
votes
2answers
92 views

Ensure correct execution order in a plugin/module architecture

Imagine a simple module-based architecture, there is the Core system that contains an array of random values. It's possible to create modules/plugins that will interact with this array. Plugin A ...
1
vote
1answer
1k views

What is the difference between Applicative and Generative Modules, and Type Classes?

Reading the comments to this blog post made me realize I don't know much about some really interesting functional mechanisms between languages like Haskell, OCaml and Standard ML. I'd love a high-...
1
vote
0answers
492 views

How to Make Reusable Classes/Package in Laravel for Billing which uses PaymentExpress?

I am working on a Laravel Project where we are Payment Express. What currently we are doing is that we have Payment Express Class with static function (Not a single property) like given below: Class ...
2
votes
2answers
143 views

When should I nest one module inside another?

Assume I'm working on a JavaScript application and make extensive use of the module pattern with one file per module. Now suppose I have two folders/modules: one for module A and another for module B. ...
24
votes
2answers
15k views

Why are packages and modules separate concepts in Java 9?

Java 9 will have modules in addition to packages. Usually languages have one or the other. And most programmers perceive two terms as synonyms. Modules are built on top of packages, treating them as ...
2
votes
1answer
93 views

Design patterns to limit cross module logic

I have a web application which has a shopping cart with cart items. The cart items are added to the user session, so must be serializable. I have a checkout class which takes the cart items and saves ...
8
votes
2answers
2k views

Is Module Pattern in JavaScript is useful only for singleton creation?

Some articles (JavaScript Module Pattern In Depth, Mastering The Module Pattern) describe defining modules in JavaScript like in the snippet below (from Addy Osmani's "Learning JavaScript Design ...
2
votes
1answer
1k views

How to structure big Node.JS modules

I am working on a rather big Node.JS project with several thousand lines of code. It's not a homepage, but acts more like a configurable general purpose application server. As such it brings some ...
12
votes
1answer
3k views

Convention to where to declare module.exports on Javascript files

Is there any convention to where we should declare the module.exports no Javascript/Node.js module files? Should it be in the beginning of the file like: module.exports = Foo; function Foo() { ...