Java Article 18 - Objects in an ArrayList - Examples of Enterprise Software used in Manufacturing

Rather than just working in the software industry, many hatchling programmers will go on to work in roles that support business and manufacturing operations.

Aside from the standard office productivity software like word processors and spreadsheets we all have seen or heard of from an early age, and all the software supporting networks and servers, there are a slew of other software packages used in business. These systems are being implemented with increasing frequency, serving an almost ridiculous variety of business needs available in off-the-shelf, modular, and custom software packages.

The term Enterprise Software is just a fancy term for Business software, however it can also refer to a business software package that serves a company-wide need verses a just a departmental need (like A CAD just being used in an engineering department).

One company I worked for had a software package dedicated to managing employee's developmental goals. So each year every employee would have to enter items that they needed to complete to develop themselves so they can do their jobs better. You might enter that you want to attended certain courses or seminars or have the company buy some periodicals or other literature for you to "continuously improve" yourself.

While I was rather impressed the company valued us so, and investing in employees is important to me, this did add extra work to everyone's already busy schedule. Managers had to review what was entered, approve or reject it, facilitate the plan, then at the end of the year ensure the plan was satisfied. Middle management was involved as well. Looking at the amount of labor involved made me question the design of the system.

One symptom of employee pushback is when you start seeing plans such as "I need to develop my ability to come up with better developmental goals."

Well enough with the anecdotes… A few common enterprise system examples that come to mind are:

Enterprise Resource Planning systems (ERP): These systems often consist of several modules including apps for production, human resources, accounting, sales, and more. They also tie together all the modules so someone in marketing can look at production volumes, product reject rates, or the status of a particular lot of product. This system is also of great interest to accounting groups since the can easily access dollar values for things like raw materials purchased and used, and product units manufactured and sold. These can also interface with web applications like an online retail store.

ERP systems for larger companies can cost from a few hundred thousand to tens of millions of dollars depending on the size of the company and what the system is designed to do. This is the total cost of ownership (TCO) which includes all the hardware, facilities, software, various support services, and in-house staff costs needed for the software. These systems can be painful to implement: It completely shut down production in one facility I worked at. This facility produced about 10 million dollars a week in revenue. Examples of ERP packages are SAP ERP and JD Edwards EnterpriseOne.

Another example would be Laboratory Information Management Systems (LIMS) which collect and manage data from various networked testing instruments providing for reviews, approvals, sample and data tracking, trending, supplemental documentation, and searching functions. Back in the 1900's (the "old days") people had to write all this data down in logbooks and then search though piles of logbooks or files of printed certificates to find the raw data and results later.

Another system common in manufacturing are Computerized Maintenance Management Systems (CMMS). Factories have equipment that needs various periodic checks, service, replacement, and calibration (maintenance). Maintenance tasks can be managed, assigned, documented, reviewed, tracked, trended, searched, and scheduled though these software packages. Maximo is a common CMMS.

In high-tech industries like the pharmaceutical industry a small building housing the manufacturing equipment for just one part of the overall process to produce just one drug can have thousands of instruments and equipment needing maintenance one or more times every year. (One of many reasons medicines are expensive).

I work a lot with production groups so today's example will be a simple form that creates objects representing raw materials used in manufacturing. This would be just a small part of what would be included in an ERP. This module would be used mainly by supervisors and employees in receiving (they receive, document, and store incoming raw materials), quality control (test and release the raw materials) and on the production floor (convert the raw materials to product).

Raw materials are identified by their name, and a lot or batch number. There can also be other forms of identification like various inventory, part, vendor, and tracking numbers. Lot numbers (referred to as batch numbers for some product types like pharmaceuticals) are of particular interest since they can be used to trace the material back to the supplier's manufacturing process or ERP system, and sometimes all the way back to the location where the martial was gown, synthesized, harvested, mined etc. Inspect a container of packaged food, a drug, or a box of gauze pads and you will see a lot number on it somewhere.

So below our example has two classes: a simple swing form MiniERP and a Lot class which is instantiated into individual lot objects which are then put into a ArrayList (more specifically a reference value to the object is put into the ArrayList). We then iterate though the ArrayList to view all the lots that were entered.

Here is MiniERP:

 
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import javax.swing.*;
import javax.swing.border.Border;


public class MiniERP extends JFrame implements ActionListener
{
	Lot lot;
	ArrayList <Lot> lotList = new ArrayList <Lot> ();
	//Create a constant for a red border
	static final Border TEXT_BORDER = 
		BorderFactory.createLineBorder(Color.red);
	
	JLabel instructionsLabel = new JLabel("Add a few lots then" +
			" click \"Show Lots\"");
	JPanel panel = new JPanel();
	JLabel materialNameLabel = new JLabel("Material Name:");
	JLabel lotLabel = new JLabel("Lot Number:");
	JButton addLotButton = new JButton("Add Lot");
	static JTextField materialNameTextField =  new JTextField(10);
	static JTextField lotNumberTextField =  new JTextField(10);
	static JTextPane textPane = new JTextPane();
	JButton showLotsButton = new JButton("Show Lots");
	
	//Constructor
	public MiniERP()
	{
		panel.add(instructionsLabel);
		panel.add(materialNameLabel);
		panel.add(materialNameTextField);
		panel.add(lotLabel);
		panel.add(lotNumberTextField);
		panel.add(addLotButton);
		panel.add(textPane);
		
		JScrollPane scrollPane = new JScrollPane(textPane);
		scrollPane.setVerticalScrollBarPolicy
		(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
		scrollPane.setPreferredSize(new Dimension(200, 200));
		panel.add(scrollPane);
	
		panel.add(showLotsButton);
		addLotButton.setActionCommand("addLotClick");
		addLotButton.addActionListener(this);
		
		showLotsButton.setActionCommand("showLotsClick");
		showLotsButton.addActionListener(this);
		//Add the red borders:
		lotNumberTextField.setBorder(TEXT_BORDER);
		materialNameTextField.setBorder(TEXT_BORDER);
		textPane.setBorder(TEXT_BORDER);
	
		add(panel);
	}

	public void actionPerformed(ActionEvent e)
	{
		
		String cmd = e.getActionCommand();	
		
		if (cmd == "addLotClick")
		{
			lot = new Lot(materialNameTextField.getText(), 
					lotNumberTextField.getText());
			lotList.add(lot); //Add the lot to the ArrayList
			materialNameTextField.setText("");
			lotNumberTextField.setText("");
			materialNameTextField.requestFocus();
		}
		
		if (cmd == "showLotsClick")
		{
			String outputText = "";
		//Iterate though the ListArray and print out all the lots:
			for (int i =0; i < lotList.size(); ++i)
			{
				lot = lotList.get(i);
				outputText += i+1 + ". Material: " 
				+ lot.getName() + "\n" 
				+ "      Lot Number: " 
				+ lot.getLotNumber() + "\n";
				textPane.setText(outputText);
			}
			materialNameTextField.requestFocus();
		}
	}
	
	public static void main(String[] args)
	{
		MiniERP miniERP = new MiniERP();
		miniERP.setSize(250, 425);
		
		//this centers our window
		Dimension dimensions = 
			Toolkit.getDefaultToolkit().getScreenSize();
		int w = miniERP.getSize().width;
	    int h = miniERP.getSize().height;
	    int x = (dimensions.width-w)/2;
	    int y = (dimensions.height-h)/2;
	    miniERP.setLocation(x,y);
	    miniERP.setTitle("MiniERP");
	    miniERP.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	    miniERP.setVisible(true);
	    materialNameTextField.requestFocus();
	}
}

And here is the Lot Class:

public class Lot 
{

	private String materialName;
	private String lotNumber;
	
	public Lot(String aName, String alotNumber)
	{
		materialName = aName;
		lotNumber = alotNumber;
	}
	
	//These are getter or accessor methods:
	public String getName()
	{
		return materialName;
	}
	
	public String getLotNumber()
	{
		return lotNumber;
	}
}