Skip to content

Getting Started

Gautam edited this page Jun 23, 2017 · 16 revisions

Getting started

Goals

  • Optimize productivity The primary goal of AppOps is to optimize development productivity while retaining high performance of the backend and to make thing overall simpler. We intend to use instrumentation wherever possible to simply stuff such as using a generator to generate it's client TypeScript interface from a Java Service interface.

  • ** Keep it simple ** Our next goal is to keep backend development as simple as possible. DI frameworks such as Google Guice already provide simplified component / application development. As of now we bring on top a very simple service architecture that allows you to develop backend services in minutes and invoke them from client.

  • ** Long life codebase ** Our last goal is to make sure resulting application code base have much longer life by guiding them into using best practices and patterns. Thus resulting in easy to maintain codebases

Project structure

AppOps client projects are typically maven multi module projects consisting of multiple services.

Define a Service

To illustrate, we'll build a Library service. it is an interface that becomes my service interface to be invoked from the client and Library service contain method declarations. This is implemented by LibraryServiceImpl class.

Design your service interface

This is the interface client code will invoke using TypeScript or other client technologies e.g.

public interface LibraryService { public List<Book> getAllBooks() ; }

Add @Service annotation

@Service public interface LibraryService { public List<Book> getAllBooks() ; }

Implement the Service class

public interface LibraryServiceImpl implements LibraryService { public List getAllBooks(){ ArrayList someBooks ; // fetch book list and assign to someBooks return someBooks ; } }

Define service binding in module

` public class LibraryModule extends AbstractModule {

  public void configure(){
      bind(LibraryService.class).to(LibraryServiceImpl.class);
  } 

}`

Lets you define a service with all it's bindings. You can bind multiple Services to their implementations in a single module. You can also have as many modules as you need in a single service project. This module is a straightforward google Guice module. So please refer to Guice documentation for more further details.

Once you are ready with this. All you need to do is package this project as a jar and add its dependency to the gims-ui project.

Clone this wiki locally