????????
???????????? ??????????????
????· ????г???
????· ????
????· ????
????????????????????????????????????????????????????????????????????
????1. ????????????
????1) ??????
????· ???????????????
????· ??????????????????
????2) ??????????
?????????????????????????????????????????? ??????????????????????????
??????????????? ????????
????3) ??????????
?????????????????????????????????????????? ??????????????????????????????????????????????? ??????????????????????? ????????????????δ???????????????????????? ??????????????????
?????????????ζ?????ò?? ???÷????????????????? ??????????? ???????-??-???????????
????4) ?????????
??????????????????????
????????????? ?????? ?????????????????????? ??????? ???????? ?????????????? ???????????????? ???????????? ?÷????Σ??????????????e??????
????5) ????????????
??????????????? ??????е??????? ?????????????????????????? ????????????????
????????????????? ???? SSoT(Single Source of Truth)?? ???????????????????????? ???????????????? ??ж??????????????????????
????2. ?????汾????
???????д????????????????????汾????
????· ?????
????· ???????
????· ????????
????· ???????????
????· ???
???????????????? ?????? Markdown ????????????????洢?? ??????汾??????
???????? https://www.websequencediagrams.com?? http://yuml.me
????· ???????????
??????????????????????????????????????????£???ó?????????
????· ???y????????
????3. ?????????
???????÷??????? ?????ī??????????????????????? ??????????????
????????????
??????????к?????????????????????IP?? ????????????????????
???????????:
??????????? ????????????壬 ???????????????廨?????
????· ini
????· properties
????· json
????· xml
????· yaml
?????? lua?? python?? ruby????????????? ???????????????????????
???????Щ????????? DSL ??????????????????????????
??????????У? ???????????????? ?????????????? ?? ?? python + json ???????????
?????????????γ????? ????????????????????????
????{
????"username": "walter"??
????"password": "xxx"??
????"email": "walter@xxx.com"??
????"courses": [  ]??
????"scores": {  }
????}
?????????python ????????
import json
import os
import sys
class UserConfig:
def __init__(self?? json_file):
self.read_config(json_file)
self.username = self.config_data['username']
self.password = self.config_data['password']
self.email = self.config_data['email']
def read_config(self?? json_file):
json_data=open(json_file)
self.config_data = json.load(json_data)
def dump_config(self):
print self.config_data
print "username="?? self.username
print "password="?? self.password
print "email="?? self.email
if __name__ == "__main__":
args = sys.argv
usage = "usage: python %s  <config_file>" % args[0]
argc = len(args)
if(argc < 2):
print usage
else:
json_file = args[1]
print("* the json config file is " + args[1])
config = UserConfig(json_file)
config.dump_config()
??????н??
????$ python user_config.py user_config.json
????* the json config file is user_config.json
????{u'username': u'walter'?? u'courses': []?? u'password': u'xxx'?? u'email': u'walter@xxx.com'?? u'scores': {}}
????username= walter
????password= xxx
????email= walter@xxx.com
?????????????
??????????????洢?????????????????????????????????
?????????????????? key/value ???

??????? Cassandra ?? NOSQL ??????
???????÷???
???????????????????????????????????????? ??REST API??????????????????? ???????е??????????????????????????????????
???????????


????
Configure Service