更好的设计方法 [英] Better design approach

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

问题描述

Hi Team,

我们正在开发项目,我们需要在方法中编写业务逻辑。将有一个main方法,它将一个接一个地调用方法来执行一些业务逻辑。

我们需要实现这种方法是更有效的方式,具有更少的依赖性和易于维护。



有人可以提出建议吗? />


我尝试了什么:



我们正在考虑从下一个方法调用以前的方法。但这不是代码的好方法。

Hi Team,
We are working on project, where we need to write business logic in method. There will be main method which will call methods one after another to execute some business logic.
We need to implement this approach is more efficient way having less dependency and easy to maintain.

Can someone please give suggestion?

What I have tried:

We are thinking to call next method from previous method. But this is not good approach to code.

推荐答案

我们无法帮助你 - 它需要对项目,运行环境,所涉及的语言和结构,公司政策,所涉及开发商的背景和技能:我们都无法访问。



并且没有一个尺寸适合所有在任何情况下都能得到你想要的结果的方法!



让你的设计团队失望,开始谈论和思考这个项目:他们是唯一的那些有任何必要信息来解决这个问题。
We can't help you - it needs intimate knowledge of the project, the environment it is to run in, the languages and structures involved, the company policies, the background and skills of the developers involved: none of which we have any access to.

And there is no "one size fits all" approach which will give teh results you want in all circumstances!

Sit your design team down, and start talking and thinking about the project: they are the only ones who have any of the required information to solve this.


阅读你的问题,我首先想到的是你正在描述一种经典的工作流驱动方法。基本上,您希望让工作流引擎决定要遵循的代码路径。例如,假设您正在处理保险报价请求,您的工作流程可能如下所示:
Reading your question, my first thought is that you are describing a classic workflow driven approach. Basically, you want to let the workflow engine decide what code path to follow. For instance, suppose that you are processing a request for an insurance quote, your workflow might look something like this:
Enter details > Compare details to risk matrices > Generate quote

这是通过您的系统的快乐路径。实际上,您的工作流程将包含您需要离开并执行其他操作的分支;例如,如果风险矩阵表明这是一个高风险客户,您可能希望将报价请求路由到另一个部门进行人工干预。



现在,不是所有基于工作流的方法都需要您对长时间运行的任务进行操作,因此创建适合您需求的工作流链是完全可以接受的。但是,大多数工作流程系统都有视觉设计师,可以让你链接你的规则和任务。



你知道我现在要建议的不是吗?是的,现在是时候开始研究一些Workflow引擎了。我将从微软的Workflow Foundation开始(它是免费提供的,并且有大量的培训资源)。

That is the "happy path" through your system. In reality, your workflow is going to contain branches where you need to go off and do something else; for instance, if the risk matrices indicate that this is a high risk customer, you might want to route the quote request to another department for manual intervention.

Now, not all workflow based approaches are going to require you to operate off on long running tasks, so it is perfectly acceptable to create workflow chains that suit your needs. However, most workflow systems have visual designers that allow you to chain your rules and tasks.

You know what I'm going to suggest now don't you? Yup, it's time for you to go off and research some Workflow engines. I would start with Microsoft's Workflow Foundation (it's freely available and there are a wealth of training resources around on this).


这篇关于更好的设计方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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