Skip to content

Releases: Mohammeddaniyal/NetworkFramework

NFramework v1.0.0 – Lightweight Networking Framework for Java 🚀

26 Mar 12:50
Compare
Choose a tag to compare

NFramework is a simple, annotation-based networking framework that enables seamless client-server communication using a custom request-response model. It allows direct method invocation on the server, making it an efficient alternative for lightweight applications.


🔥 Features

✔️ Annotation-based API for defining endpoints.
✔️ Custom request-response model for optimized performance.
✔️ Automatic method invocation on the server.
✔️ Lightweight and dependency-free – only requires the included JARs.
✔️ Simple client execution with execute() calls.


🛠 Installation

1️⃣ Download the JAR Files

Get the latest NFramework Server & Client JARs from this release.

2️⃣ Include Them in Your Project

Run the server and client using the following commands:

# Running the server
java -cp nframework-server.jar BankService

# Running the client
java -cp nframework-client.jar BankClient

3️⃣ Implement Your API

Use simple annotations to define server methods.


📌 Example Usage


🖥️ Server Code

📥 Required Imports

import com.thinking.machines.nframework.server.*;
import com.thinking.machines.nframework.server.annotations.*;

🛠 Implementation

@Path("/banking")
public class BankService {
    @Path("/branchName")
    public String getBranch(String city) {
        return city.equals("Mumbai") ? "Colaba" : "Unknown Branch";
    }
}

💻 Client Code

📥 Required Imports

import com.thinking.machines.nframework.client.*;

🛠 Implementation

NFrameworkClient client = new NFrameworkClient();
String branch = (String) client.execute("/banking/branchName", "Mumbai");
System.out.println("Branch: " + branch);

Future Improvements

🔹 Configurable ports (currently hardcoded to 5500).
🔹 Improved error handling for better debugging.
🔹 Async request handling for better performance.


📢 Try it out and let us know your feedback! 🚀