3 Tier Architecture vs 2 Tier Architecture

后端 未结 6 544
面向向阳花
面向向阳花 2020-12-13 08:00

What are the examples where we really need 3 Tier Architecture ? Can Most of the Application which are using 3 Tier Architecture be done using 2 Tier Architecture ?

6条回答
  •  执念已碎
    2020-12-13 08:10

    Props to FinnNk, but let me give you an example of what happens when you don't separate your tiers. I've worked, for years now, on a project that was badly separated at birth. All three tiers -- more, if you believe what tuinstoel said -- lumped into individual JSP pages. I'm sure it seemed like a smart thing at the time (faster to code when you're just starting) but this monstrosity has grown and grown, and no one took the time to refactor.

    We now have 2000+ JSP pages, with duplicate code scattered throughout. Making a schema change requires careful backtracking to figure out what pages might be effected, and individual testing of each of those pages. No one in management thinks it's important enough to spend the time to fix this -- short term gains, long term loss.

    Do. Not. Go. This. Route.

    Separating tiers leads to better, faster, more testable, more modular code. You'll thank yourself for it, and (more importantly) the people who come after you will thank you for it.

提交回复
热议问题