Code Monkey home page Code Monkey logo

bearcat's Introduction

Bearcat -- a POJOs based application framework

Bearcat is a POJOs based application framework which provides a lightweight container for writing simple, maintainable node.js. Bearcat provides an infrastructural backbone to manage business objects so that developers can focus on application-level business logic. Bearcat enables you to build applications from "plain old javaScript object"(POJO) and to apply enterprise services non-invasively to POJOs.

###Simple POJOs + Configuration metadatas = Elastic, maintainable system

Build Status

Features

lightweight container

  • Dependency injection implementated Inversion of Control (IoC) to manage POJOs
  • AOP based declarative middleware services
  • Consistent development and configuration

Easy

  • Simple meta configuration and POJOs
  • Lightweight: high development efficiency based on node.js
  • Reuseable: POJOs can be used to any development environment
  • Invasive: there's no dependence on a container API
  • Modular: you just use only those parts that you need
  • One stop shop: no need for a dedicated Singleton or factory for every object etc
  • Easy to mock objects for unit test based on IoC

Powerful

Extensible

  • Custom features: you can add custom codes to container

What is POJO ?

POJO is an acronym for Plain Old Java Object, you can refer to POJO wikipedia. It is mostly used in Java Platform which is used to emphasize that a given object is an ordinary Java Object, not a special object.
In Node, what is POJO ?
It must be Plain Old JavaScript Object, which is simple, ordinary, and not anonymous.
To be not anonymous, it must have Constructor function.
So POJO can be like this:

var POJO = function() {
	this.props = null;
}

POJO.prototype.method = function() {
	
}

module.exports = POJO;

Why should we use POJO ?

  • POJO is simple, everyone can write it
  • POJO makes development consistently, all your codes is POJOs
  • POJO makes it friendly to document

Usage

Running bearcat is quite simple, all you have to do is to write simple POJOs and simple configuration metadatas like context.json, after this, passing context.json paths to bearcat, and run it, then all your POJOs will be magicly turned into an elastic, maintainable system.

var Bearcat = require('bearcat');
var contextPath = require.resolve('./context.json');

var bearcat = Bearcat.createApp([contextPath]);
bearcat.start(function(){
   var helloBearcat = bearcat.getBean('helloBearcat'); // get bean
   helloBearcat.hello(); // call the method
});

Codes written by simple POJOs and simple configuration metadatas can be run without Bearcat, however, in this case, you should have to do a lot of things by yourself, like handling dependency, configuration

more bearcat apis can be refered to bearcat-api

License

(The MIT License)

Copyright (c) fantasyni and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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.