Mandarine.TS
Latest
Latest
  • Mandarine.TS
  • Getting started
    • Installing Deno Runtime
    • Setting up Environment
    • Quick Example
  • Concepts
  • Mandarine Project Structure
  • Mandarine CLI
    • CLI Reference
      • mandarine new
      • mandarine generate
      • mandarine run
  • Mandarine Core
    • Core Initialization
    • Mandarine.json
    • Dot env file
    • Properties
      • The @Value Decorator
    • Components
      • Controller
      • Middleware
      • Repository
      • Component
      • Service
      • Configuration
      • Manual Component
    • Dependency Injection
      • Accessing DI container
    • Resource Handlers
      • Resource Handler Registry
      • Resource Handler
      • Resource Resolver
  • Mandarine MVC
    • Web MVC
    • Controllers
      • Routes
        • Parameterized Routes
      • HTTP Handlers
      • @ResponseStatus
    • Custom Middleware
    • Session Middleware
    • CORS Middleware
    • Template Engine
      • @Render Decorator
      • Accessing data from template
    • Launching web-app
    • Serving Static Content
    • Multipart Form Data
  • Mandarine Security
    • Sessions
  • Mandarine Data
    • ORM
      • Data source
      • Models
      • Repositories
        • Interacting with data
        • Updating data
    • Mandarine Query Language
  • Resources
    • Changelog
  • Plugins
    • Optional
    • Promise Repeater
Powered by GitBook
On this page
  • What are components?
  • Declaration
  • Injecting objects
  • Types of Components

Was this helpful?

  1. Mandarine Core

Components

PreviousThe @Value DecoratorNextController

Last updated 4 years ago

Was this helpful?

This page summarizes all the information about mandarine components and how & why they are used in Mandarine-powered applications.

What are components?

Mandarine has the concept of "components", components help diversify your application in different layers such as

  1. Configuration Layer

  2. Service Layer

  3. ORM Layer

  4. Others...

Components are used across Mandarine-powered applications mostly for dependency injection (DI) but its concept can go beyond, for example, Controllers are a type of component specifically created to handle HTTP requests (this if you are using Mandarine MVC).

Declaration

Components are declared by using typescript decorators . All Component decorators should target a class.

Injecting objects

Most components accept the use of DI. DI can be achieved through class fields or by using constructor parameters.

Types of Components

  • Controller

  • Middleware

  • Repository

  • Component

  • Service

  • Configuration

  • Manual Component

(Click here to see more)
See enum here