zoukankan      html  css  js  c++  java
  • Introduction Constretto Core Confluence

    Introduction - Constretto Core - Confluence


     
    What is Constretto?

    Constretto is a Java framework providing a simple API for accessing configuration data from several different sources like property files, Ini files and JavaBeans. It allows each configuration element to optionally be tagged, in much the same way as we are familiar from the web, with tags that Constretto later uses to resolve which value to use.

    Constrettos main goal is to solve a common problem found in most enterprise Java applications :

    "How can I deploy my application in several environments, without rebuilding it ?"
    Example Scenario

    We have a simple Java Web application for business managers where the manager can register contact information on employees, so that she later easy can find an employees mobile phone number, if she needs to get in contact with them. The application uses a Database to store employee data.

    When developing this application, we most likely need to deploy this application on several different servers, the graph below shows a typical deployment scenario:

    In the scenario above, we have a challenge, and that is "Wow do I manage my connection URL to the database without rebuilding the war file for each environment ?"

    Constretto answer to that question is tags. By tagging your configuration elements you may specify which value to use in the different environments. How tags are defined varies in the different configuration sources, and the example below shows how this is done with Ini files :
    ?
    [development]
          employee.db = jdbc:derby:target/employee;create=true
        [test]
          employee.db = jdbc:postgresql://testserver/employee
        [preprod]
          employee.db = jdbc:postgresql://preprodserver/employee
        [production]
          employee.db = jdbc:postgresql://production/employee

    Now that we have tagged our configuration, we can tell Constretto which tags to use when we start our application, and the correct value for the connection url is chosen at runtime.

    for further reading, please look at the Quick start guide to get you started, or the User guide for details.

    Labels:


  • 相关阅读:
    Centos6.6安装Nginx
    Centos6.6升级python版本
    基于Centos6.6的R720服务器四网口端口聚合的实践
    wcf 开发 1
    dev 转自
    SQL查询父节点下的所有子节点(包括子节点下的子节点,无限子节点)
    C# 自定义控件摘记
    C#中的自定义控件中的属性、事件及一些相关特性的总结(转)
    DevExpress控件-lookupedit的使用方法详解(图文)转http://blog.csdn.net/qq395537505/article/details/50920508
    【DevExpress】 SearchLookUpEdit
  • 原文地址:https://www.cnblogs.com/lexus/p/2392854.html
Copyright © 2011-2022 走看看