mercredi 8 mai 2019

create architecture design for dynamic functionality using javascript

We need to have the ability to turn on/off feature on the client side with control from the server.
Example: Let's say we release functionality A but we only want this feature going to set of customer. Let's say customer 1. At first pass, we will make API call to the server with customer information. The server will say that feature A is on for customer 1. But for customer 2 when he/she make API call feature A will be off. We will leverage that and gradually increase to all customer and feature A will be permanent. Same goes for feature B, C, D down the road.
If we have a bunch of if and else and check for feature name we will have much dead code lying around. Effort in remove and clean up will be cumbersome.

How can I design a javascript code that it will dynamically adapt and turn on off on new feature and be able to reuse that same logic for any future feature? Can we use some type of the dynamic variable or object-oriented way to achieve this?

Thanks

Aucun commentaire:

Enregistrer un commentaire