java - app或者微信也公用这套后端代码可以吗?还是重写一套后端代码呢?
高洛峰
高洛峰 2017-04-18 10:47:48
0
2
642

我现在做了一个类似投资理财的网站(pc端耳朵),有假数据,我想在app或者微信也公用这套后端代码可以吗?还是重写一套后端代码呢?pc和app微信各一套,如果就公用一套,我现在的后端代码怎么给app展现数据??没有做过app后端,大神们说说

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
伊谢尔伦

Whether it can be shared publicly depends on how you write the code. If it is a project with separate front-end and back-end, just reuse the designed API. If it is the kind of code that is responsible for both the data layer and the presentation layer, you need to provide a pure data layer interface based on this set of code.

For example, you originally rendered the page like this
// Pseudo code
return res.render(view, data);
Then you should now provide an interface with only data like
// Pseudo code
return data;

大家讲道理

Don’t reinvent the wheel. If it can be reused, why not reuse it? Otherwise, the workload will be huge during update and maintenance.
Even if the API interface cannot be reused, the original business logic can abstract some reusable underlying logic, so that only the new upper-level logic can be opened.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template