Назад к каталогу
tinystruct

tinystruct

Сообщество

от tinystruct

0.0
0 отзывов

A lightweight, modular Java application framework for web and CLI development, designed for AI integration and plugin-based architecture. Enabling developers to create robust solutions with ease for building efficient and scalable applications.

Описание

`"How many are your works, O LORD ! In wisdom you made them all; the earth is full of your creatures."` ***Psalms 104:24*** The tinystruct framework -- A simple framework for Java development. Simple thinking, Better design, Easy to be used with better performance! [![Star History Chart](https://api.star-history.com/svg?repos=tinystruct/tinystruct&type=Date)](https://www.star-history.com/#tinystruct/tinystruct&Date) ## Prerequisites - Java Development Kit (JDK) 17 or higher - Maven (for dependency management) - A text editor or IDE (IntelliJ IDEA, Eclipse, VS Code, etc.) Getting Started with tinystruct archetype -- You can follow this archetype to create a tinystruct-based project quickly: https://github.com/tinystruct/tinystruct-archetype Installation and Getting Started Manually -- * Add the dependency into your pom.xml. ```xml <dependency> <groupId>org.tinystruct</groupId> <artifactId>tinystruct</artifactId> <version>1.7.12</version> <classifier>jar-with-dependencies</classifier> <!-- Optional --> </dependency> ``` * Extend the AbstractApplication in Java: ```java package tinystruct.examples; import org.tinystruct.AbstractApplication; import org.tinystruct.ApplicationException; import org.tinystruct.system.annotation.Action; public class example extends AbstractApplication { @Override public void init() { // TODO Auto-generated method stub } @Override public String version() { return "1.0"; } @Action("praise") public String praise() { return "Praise the Lord!"; } @Action("say") public String say() throws ApplicationException { if (null != getContext().getAttribute("--words")) return getContext().getAttribute("--words").toString(); throw new ApplicationException("Could not find the parameter <i>words</i>."); } @Action("say") public String say(String words) { return words; } @Action(value = "hello", mode = Mode.HTTP_GET) public String helloGet() { return "GET"; } @Action(value = "hello", mode = Mode.HTTP_POST) public String helloPost() { return "POST"; } } ``` Smalltalk: <a href="https://github.com/tinystruct/smalltalk">https://github.com/tinystruct/smalltalk</a> Execute in CLI mode -- ```tcsh $ bin/dispatcher --version _/ ' _ _/ _ _ _/ / / /) (/ _) / / (/ ( / 1.7.12 / ``` ```tcsh $ bin/dispatcher --help Usage: bin/dispatcher COMMAND [OPTIONS] A command line tool for tinystruct framework Commands: download Download a resource from other servers exec To execute native command(s) generate POJO object generator install Install a package maven-wrapper Extract Maven Wrapper open Start a default browser to open the specific URL say Output words set Set system property sql-execute Executes the given SQL statement, which may be an INSERT, UPDATE, DELETE, or DDL statement sql-query Executes the given SQL statement, which returns a single ResultSet object update Update for latest version Options: --allow-remote-access Allow to be accessed remotely --help Help command --host Host name / IP --import Import application --logo Print logo --settings Print settings --version Print version Run 'bin/dispatcher COMMAND --help' for more information on a command. ``` ```tcsh $ bin/dispatcher say/"Praise the Lord" Praise the Lord ``` ```tcsh $ bin/dispatcher say --words Hello --import tinystruct.examples.example Hello ``` Run it in a http server -- ```tcsh # bin/dispatcher start --import org.tinystruct.system.HttpServer ``` You can access the below URLs: * <a href="http://localhost:8080/?q=say/Praise%20to%20the%20Lord!">http://localhost:8080/?q=say/Praise%20to%20the%20Lord! </a> * <a href="http://localhost:8080/?q=praise">http://localhost:8080/?q=praise</a> Performance Test -- ```tcsh $ wrk -t12 -c400 -d30s "http://127.0.0.1:8080/?q=say/Praise the Lord!" Running 30s test @ http://127.0.0.1:8080/?q=say/Praise the Lord! 12 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 17.44ms 33.42ms 377.73ms 88.98% Req/Sec 7.27k 1.66k 13.55k 69.94% 2604473 requests in 30.02s, 524.09MB read Requests/sec: 86753.98 Transfer/sec: 17.46MB ``` Handling over **86,000** requests per second with low average latency (~17.44ms), indicating the endpoint is highly efficient under heavy load. this shows the raw power and efficiency of the **tinystruct framework**. But it's not just about the performance numbers. It's about the **philosophy** behind it. ### What makes tinystruct framework modern? 1. **No `main()` method requi

Отзывы (0)

Пока нет отзывов. Будьте первым!