• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xoxo419
V2EX  ›  程序员

项目设计 业务逻辑分开

  •  
  •   xoxo419 · Apr 19, 2018 · 2472 views
    This topic created in 3122 days ago, the information mentioned may be changed or developed.

    文件结构

    项目有 PC 端、wap 端、APP 接口

    现在我想把业务逻辑写到 Logic 下, Modules 下面只渲染和简单的判断, 不直接于数据库交互.

    好处是写好一套业务逻辑后, 三端就可同时用了.

    大家的项目对于多端时又是如何设计的呢?

    2 replies  •  2018-04-19 16:15:31 +08:00
    Dawnki
    Dawnki
    Apr 19, 2018 via iPhone
    1
    业务逻辑做成服务,然后依赖注入 laravel 的 ioc 就不错
    ai277014717
    ai277014717
    Apr 19, 2018
    2
    前后端分离,前端用 ajax 拿数据,有自己 UI 层 model。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3669 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 04:14 · PVG 12:14 · LAX 20:14 · JFK 23:14
    ♥ Do have faith in what you're doing.