Questions tagged [modules]

The tag has no usage guidance.

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

Repeated code in the modular REST API [on hold]

I have built the REST API which is divided into several modules. I'm currently working on data validation (I create my own attributes). Attributes can be used in many modules. Since the API is ...
0
votes
0answers
17 views

Appropriate structure for keeping large number of similar functions

I have a class that gets initialized with an array of lambda functions. These functions then get called in another method: class MyClass def initialize(funcs) @my_funcs = funcs end def ...
2
votes
1answer
54 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
55 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
275 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
207 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 ...
0
votes
1answer
242 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....
2
votes
0answers
66 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
235 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
73 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
152 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
451 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
1k 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
64 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
179 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
405 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
205 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
7answers
2k 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
80 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 ...
2
votes
0answers
307 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
66 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) ...
15
votes
1answer
32k 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
415 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
68 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
88 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 ...
0
votes
1answer
841 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
422 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
134 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. ...
18
votes
2answers
8k views

Why packages and modules are 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
90 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 ...
7
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
881 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 ...
9
votes
1answer
2k 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() { ...
2
votes
2answers
3k views

writing a controller file in Python

I need some advice on my idea to write a controller file in Python, and not like the C in MVC type controller but a more simpler idea. Just a Python script that controls the operation of some other ...
1
vote
1answer
964 views

Should I use autoloaders in modules?

Lets say I'm running a PHP app like Magento, PrestaShop. Now these system have their own complex autoloaders to load controllers based on routes, required classes, models, etc. Most of the time as a ...
1
vote
1answer
3k views

Should I automatically install needed modules?

I'm writing a program for my grandpa. Occasionally an update will require a new module that's not installed on his computer. I don't want to have to manually install new modules every time, but he's ...
3
votes
1answer
107 views

Are there any problems with defining a single-source “module” in C using conditional compilation to separate the “header” from “source”

I'm writing a project that I want to keep small in the sense of being very densely-coded and a single source file. But it's growing large enough that navigating the file is becoming tiresome, so I ...
0
votes
1answer
793 views

Setting up folders and importing modules in Python

I'm building an app to automate some processes that are annoying to do by hand (looking in a file, taking certain information out of a file, building another file with that information). My project ...
1
vote
1answer
1k views

Program design - how to improve it and how to avoid coupling (Python)?

In the Python program structure below there are two modules with functions. Problem description: Functions are used inside other functions all over the place. Strong coupling (dependency). For ...
1
vote
1answer
1k views

Python, namespace vs module with underscores

I'm developing a project that uses several independent modules, but all related to the same project. However, I face this choice: module names with underscore vs. namespaces. For example there is ...
4
votes
2answers
150 views

Does modular programming refer to modules or programs?

As far as I can tell, the main idea in modular programming is: program pieces that work well; complex behaviour results from piece_a and piece_b working together Though, I am not sure if it ...
1
vote
0answers
109 views

Modular application - dependency as separate module?

I have a modular application written in Java based on NetBeans Modules (those details probably aren't so important :-) ) and I'd like to add another module written in Clojure language. Clojure ...
2
votes
1answer
118 views

The meaning of 'fully traversable namespaces' in JavaScript

During research into architecture of single page applications, I came across the following resource by Mikito Takada, written around 2013: http://singlepageappbook.com/ In his introduction he ...
1
vote
2answers
2k views

How to make scalable modules in a div element

I'm interested in creating web modules that are encapsulated by a div element in a manner that, by simply resizing the div, everything in that div scales to the dimensions of that div proportionately (...
0
votes
1answer
936 views

Publish Modules from a Java Project on Github and integrate into IntelliJ [closed]

What is the best practice to work with several Java modules from different GitHub sources using IntelliJ? This might be an odd qeustion but I do not know what the standard workflow is to achieve what ...
1
vote
1answer
152 views

Ideal export in terms of size for asynchronous module definitions in JavaScript?

When creating AMD modules you can export whatever you like whether it be an object or a function. I vaguely recall reading a recommendation somewhere to export just one thing; the idea being "keep it ...
4
votes
2answers
3k views

PHP package management with/without Composer

I noticed that many (large) PHP applications use Composer for managing the dependencies. I'm currently trying to figure out if I should switch to Composer (at the moment I'm simply keeping my ...
5
votes
1answer
216 views

How to introduce Google Analytics code in a modular way?

We are working on a very large codebase. It's basically a web-based operating system, with its own file system and applications. The system's UIs are generated dynamically with Javascript. We've ...
3
votes
1answer
175 views

How to tell that a Javascript code already needs AMD (RequireJS, …)?

At some point code is complicated less if you introduce a new abstract than if you continue as it was. Some trigger should fire in a head of a programmer. Like, I was coding fine, but now I've added ...