mardi 4 décembre 2018

General advice on creating "standard" components across multiple languages

Long story short: I am looking for advice on how to go about creating a "standard" library of components/wrappers that are functionally identical across multiple languages. The end goal is to have common library that all software uses so that changes to our backend can be easily made without having to touch 100+ pieces of software

A simple example would be a logging wrapper that takes a log name and verbosity level. It will have a default logging/timestamp format, directory location, and .log extension. The backend implementation will vary but the output should be the same.

Java

public Logger log = new Logger("mylog", 20);
log.info("This is a Java log")

Python

log = Logger("mylog", 20)
log.info("This is a Python log")

C#

public Logger log = new Logger("mylog", 20);
log.info("This is a C# log")

Output in mylog.log:

2018-12-04 15:00:00 | INFO | This is a Java log

2018-12-04 15:00:01 | INFO | This is a Python log

2018-12-04 15:00:02 | INFO | This is a C# log

Assuming the following:

  • Languages used are Java, C#, Python
  • GitHub is used
  • Number of library components will start at 3, but grow slowly to potentially 10+.
  • First three components/wrappers will be logging, SQL connection, configuration file reader/writer
  • Each language would be released, such as a DLL or JAR.
  • There are over a dozen developers and 100+ scripts/apps/GUIs, etc.

The questions that I have and would like advice about are:

  1. Should each language have its own repository? (I can think of pros/cons of each and have started to lean having on separate repos)
  2. How to handle different IDEs? e.g. Java with Eclipse or NetBeans. Should the build be run from cli?
  3. Thoughts on versioning? i.e. all components are initially released at version 1.0. C# logging gets an update and is now version 1.1. Ideally, and with discipline, Java and Python should be updated at the same time and be versioned identically.
  4. Any pitfalls to this approach?
  5. Is this approach common in small or large organizations?
  6. Am I crazy for trying this?!

Longer story: we have machines (literal machines in manufacturing) as well as PCs that range from 0-25 years old. PLCs, Windows/Linux/Mac, mobile, GUI/command line apps, etc. This is something that cannot be changed because it is simply impossible to update everything.

Due to this, we use multiple languages within our organization, mainly Java, Python, and .NET. Also, because of wide variety of machinery and PCs, we have 100+ scripts, applications (both simply and very complex), web interfaces, etc. They are used for things like automated data collection, manual data entry, or graph display.

Since there are so many different programs created by many developers, we are attempting to create a set of common components that are essentially the same across multiple languages.

Aucun commentaire:

Enregistrer un commentaire