建筑难题 [英] Architectural conundrum

查看:141
本文介绍了建筑难题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个人的项目工作时最糟糕的事情是缺乏输入,你通常是从你的同事获得。而且由于缺乏,你往往使明显的错误。

The worst thing when working on a one man project is the lack of input that you usually get from your coworkers. And because of the lack of that you tend to make obvious mistakes.

从这条路下来了一段时间后,我需要从社区一些帮助。

After going down that road for some time I would need some help from the community.

我开始有点自造项目,应该变成的某些种类的门户。这是困扰我的主要事情是我编造的持久层。它应该从起动器和一个OR映射器的presentation层完全分离也是某处。这是因为我有必须使用多个数据存储。

I started a little home-brew project that should turn into a portal of some sorts. And the main thing that is bothering me is the persistence layer that i have concocted. It should be completely separated from the presentation layer for starters and a OR mapper is also somewhere. This is because I have multiple data stores that have to be used.

所以基本想法是,个人资源库在他们的单个数据库操作每个和业务层,然后聚合业务对象然后将其转化在presentation层进入视图对象。

So the base idea was that the individual "repositories" operate each on their individual database and that the business layer then aggregates the business objects which are then transformed in the presentation layer into view objects.

我面对的主要问题如下:

The main problem I face is the following:

多类相同的概念 - 有一个DAL重新presentation一个的用户的和BL重新$ P $的psentation的用户用户。我可以处理工具的转变,但是,这真的是正确的做法。我的意思是他们都很好地分离,但是开销是相当的东西。

Multiple classes for the same concept - There is a DAL representation of a user and BL representation of user and a view representation of a user. I can handle the transformation with a tool but is this really the right way. I mean they are all nicely separated, but the overhead is quite something.

你觉得呢?我该怎么过深入关注兔子洞分离还是这仍属正常?

What do you think? Am I going too deep into the separation of concern rabbit hole or is this still normal?

推荐答案

这是比正常多。结果
通常没有人做这和呼声关于ORM懒加载问题呈现HTML或诸如此类的东西时。

This is more than normal.
Usually no one does this and cries about ORM lazy loading issues when rendering html or whatnot.

这是更容易编写DTO层,而不是同时考虑DA,BLL和UI。有的甚至走得更远,并应用命令&放大器;在建筑的规模显然查询分离绘图输入/输出之间的线(即解决了像需要人工业务对象,实际上仅用于报告的目的问题)。

It's easier to write DTO layer than to think about DA, BLL and UI simultaneously. Some go even further and apply command & query separation in architectural scale clearly drawing line between input/output (that solves problems like need for artificial business object that actually is used for reporting purposes only).

在另一方面 - 它取决于。如果您的应用程序将是简单的,你可能不需要那么多的抽象(例如简单的投资组合公司的主页)。

On the other hand - it depends. If your app is going to be simple, you might not need so much abstraction (e.g. simple company portfolio home page).

这篇关于建筑难题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆