用函数,异常,分层能否解决问题?
具体该怎样解决问题?这是目前需要认真思考的问题。
先举个例子,比如某表tb1主键为两个字段fa,fb,有个函数是用两个值去查第三个唯一值。
这个函数位于一系列处理的中间,当表中均为正常值时没啥问题,但表中缺乏程序继续运行的值时,怎样的代码结构才算合理?
11-28
以表为核心的程序中,函数可分为:condition,query,execute,mapping几种.
condition是条件检测,符合条件的进入下一函数.
query是查询,执行select获取想要的值.
execute是执行,执行delete,update和insert以让DB出现想要的结果.
mapping是匹配,将对象匹配到字段或反过来.
--待续--