Giter VIP home page Giter VIP logo

tinystruct / tinystruct Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 1.0 1.19 MB

A simple framework for Java development. Simplicity is difficult, while complexity is easy. Better thinking leads to better design.

Home Page: http://tinystruct.org

Shell 1.37% Batchfile 0.47% Java 98.04% Lua 0.12%
framework java lightweight-framework modular-design webframework tinystruct undertow netty tomcat

tinystruct's Introduction

"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!

Installation and Getting Started

  • Add the dependency into your pom.xml.
<dependency>
  <groupId>org.tinystruct</groupId>
  <artifactId>tinystruct</artifactId>
  <version>1.2.6</version>
  <classifier>jar-with-dependencies</classifier>
</dependency>
  • Extend the AbstractApplication in 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 to the Lord!";
    }

    @Action("say")
    public String say() throws ApplicationException {
        if (null != this.context.getAttribute("--words"))
            return this.context.getAttribute("--words").toString();

        throw new ApplicationException("Could not find the parameter <i>words</i>.");
    }

    @Action("say")
    public String say(String words) {
        return words;
    }

}

Smalltalk: https://github.com/tinystruct/smalltalk

Execute in CLI mode

$ bin/dispatcher --version

  _/  '         _ _/  _     _ _/
  /  /  /) (/ _)  /  /  (/ (  /  1.2.6
           /
$ bin/dispatcher --help
Usage: bin/dispatcher COMMAND [OPTIONS]
Commands: 
        download                Download a resource from other servers
        exec                    To execute native command(s)
        generate                POJO object generator
        install                 Install a package
        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, or DELETE statement or an SQL statement that returns nothing, such as an SQL 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.
$ bin/dispatcher say/"Praise to the Lord"
Praise to the Lord
$ bin/dispatcher say --words Hello --import tinystruct.examples.example
Hello

Run it in a http server based on netty

# bin/dispatcher start --import org.tinystruct.system.NettyHttpServer 

You can access the below URLs:

Architecture

tinystruct-framework-architecture

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

tinystruct's People

Contributors

dependabot[bot] avatar m0ver avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tinystruct's Issues

๐Ÿš€ Exciting News: Critical Issue Fixed in tinystruct Framework! ๐Ÿš€

Dear tinystruct Community,

We are thrilled to announce that a critical issue in the tinystruct framework has been successfully addressed and fixed in the latest update!

Issue Details:

Nature: Critical
Impact: The issue could lead to a significant exposure of sensitive data in web projects utilizing the tinystruct framework.
Resolution: We have provided an execution mode for each action, restricting the execution of any Java method defined in your module to be executed only in CLI mode. This enhancement ensures greater security and mitigates the risk of sensitive data exposure.

How to Update:
To ensure that your projects benefit from the latest fixes and improvements, please follow these simple steps:

  1. Update the tinystruct framework version to 1.2.6 in your pom.xml file.
  2. Compile your project and redeploy it as soon as possible to incorporate the latest changes.
  3. For users of the Smalltalk Docker image, it's essential to use the latest image by executing the command: docker pull m0ver/smallltalk:latest. This latest image includes the tinystruct-1.2.6.jar upgrade.

Community Feedback:
Your feedback and contributions are invaluable to us. If you encounter any issues or have suggestions for further improvements, please don't hesitate to reach out to us on this GitHub issues channel.

Thank you for your continued support and dedication to the tinystruct framework. Together, we're building a stronger and more reliable platform for all developers!

Best regards,
James

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.