JMRI: LogixNG Documentation
Author: Daniel Bergqvist
Keywords: logixng model railroad JMRI LogixNG PanelPro

# LogixNG - Sockets

## Sockets

LogixNG is designed to be flexible and easy to extend. A major idea is that tools should not need to know details of expressions and actions.

A LogixNG has a tree of Actions, Expressions, and more, and these are connected by sockets. The parent has one or more female sockets and every child has a male socket.

When an Action or Expression is created and registered in its manager, it's given a male socket. And it's always thru the male socket that the Action or Expression is handled.

When a LogixNG editor wants to create an action or expression to put into a female socket, it can ask the LogixNG_Manager which classes that is possible to connect to this female socket and then let the user select one of these.

An action or expression can have any number of female sockets of any type, which means that the structure is very flexible. For example, the ActionIfThen action has a female Expression socket and a female Action socket. And the ActionDoStringAction has a female StringExpression and a female StringAction.

The LogixNG toolsm for example the editor, doesn't need to know about the actions, expressions, and others, which means that completely new types can be added without needing to change the LogixNG tools.

## Female sockets

The female sockets tells the LogixNG tools that there is a place to connect something. And the female socket can tell if any given male socket is compatible with this female socket.

## Male sockets

The male sockets is used to plug in into a compatible female socket.

The male sockets also handles some generic logic for their action or expression, for example debug tools and logging.