Design pattern for invoking various business rules for submitted user interface elements

I am working on a project that is developing an application for three clients. All customers are satisfied with the base product that we produce. 2 of them have slightly different requirements - about the visibility of certain controls, different data bindings to drop-down lists, etc.

My question is: knowing that each of the 3 clients will continue their own specific requirements, what is the best way to implement these requirements in the user interface?

I don’t like the idea of ​​having a series of IF statements in every web form that I have, and manipulating the drop-down lists and controlling visibility separately. It just puts my well-organized files with user requirements.

Can someone point me to the template (s) that can match the account?

Take a look at this simplified hypothetical example to find out what I'm talking about:

  • The web form is filled in a drop-down list in which there are 3 menu items (for example, home number, business number, number abroad); the drop-down menu is used to record the type of phone number in contact

  • 2 of my clients are happy to associate as many phone contacts with a contact (even if duplicates may occur)

  • 1 , " " " " , " "

, , . " ", , , .

+3
3

- , .

ASP.Net , .

, Page , , , Page , .

, - :

protected void Page_Load(object sender, EventArgs e)
{
    PreRender += ConfigurationInterceptors;
}

ConfigurationInterceptors , , , , , , - .

protected void ConfigurationInterceptors(object sender, EventArgs e)
{
    Interceptor interceptor = new Interceptor(this.Page);
}

Interceptor - , FindControl .

, .

0
0

, . ASP.NET. , , , , , .

. , . , , , , ... , , 95% , .

Another option is to require each page to be performed using additional steps, possibly creating your own "OnXXX" events (OnOurCompanyPreInit, OnOurCompanyInit, etc.), in which you add additional logic for each client.

One of the drawbacks of frameworks such as ASP.NET is that it strives to be very flexible, it provides a certain separation of problems that may not coincide with the section of problems that you need.

0
source

Source: https://habr.com/ru/post/1752616/


All Articles