Click here to Skip to main content
15,888,733 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Posted
Updated 3-Feb-17 0:09am
Comments
dan!sh 3-Feb-17 3:23am    
Not a good question. Did you just pasted an email here?

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.
 
Share this answer
 
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
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).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900