How aadewunmi/javafx_chat_messenger_application works
Project Type & Purpose
• The project is a desktop chat application where users run a client and communicate with a server using TCP/IP.
• It leverages JavaFX for the graphical user interface and Java sockets for networking.
• The README specifies how to launch both the ClientApplication and the ServerApplication.
Analyzing the File Structure
• At the top level, you have standard Maven build files (pom.xml, mvnw, etc.) which indicate the build and dependency management.
• The src/main/java directory contains a package hierarchy under “com/application/javafx_chat_messenger_application” further divided into “client” and “server” subdirectories.
• Under “client” there are:
▪ Client.java, ClientApplication.java, and ClientController.java – which handle the client logic and UI interactions.
▪ The corresponding FXML file for the client UI is in src/main/resources under the matching package path (client-view.fxml).
• Under “server” there are:
▪ Server.java, ServerApplication.java, and ServerController.java – which manage the server logic and its interface.
▪ Its corresponding FXML is “server-view.fxml”.
• The presence of both “client” and “server” packages indicates well-separated responsibilities for each role in the application.
Key Architectural Components
• Client Module:
• ClientApplication (entry point for the client) which initializes JavaFX and displays the UI.
• ClientController that processes user events and interacts with the network layer.
• A separate Client class handling specific socket communications.
• Associated client-view.fxml for the JavaFX UI.
• Server Module:
• ServerApplication which starts the server side of the application.
• ServerController that manages server actions and UI events (if any).
• A Server class to manage TCP socket connections and client communications.
• Associated server-view.fxml for the UI.
• The Maven build system and module-info.java (for Java Platform Module System compatibility) are essential parts of the development environment.
• Client Application Module:
▪ UI Layer (represented by ClientApplication and client-view.fxml)
▪ Controller Layer (ClientController)
▪ Networking Module (Client handling socket communications)
• Server Application Module:
▪ UI Layer (ServerApplication and server-view.fxml)
▪ Controller Layer (ServerController)
▪ Networking Module (Server handling socket connections and communication logic)
• Infrastructure Component:
▪ TCP/IP network (illustrated as the channel over which client and server interact)
• Build/Deployment Environment:
▪ Maven build system and configuration files (pom.xml, mvnw, etc.)
b. Relationships and interactions:
• Bidirectional communication between the Client’s Networking Module and the Server’s Networking Module (TCP/IP channel).
• From the Server’s side, indicate how incoming connections are processed by the ServerController and UI.
c. Architectural Patterns / Design Principles:
• Separation of concerns: Each module (client and server) is clearly separated by functionality (UI, controller, networking).
• MVC-like structure: The use of FXML for views with separate controller classes follows a Model-View-Controller pattern.
• Client-Server Communication: Clearly established via socket programming over TCP/IP.
d. Specify Relevant Technologies:
• Java 11
• JavaFX for the UI
• Java sockets for networking
• Maven for building and dependency management