mercredi 3 juin 2015

What is best design pattern for handling rpc requests?

I'm now developing a json-rpc project in C++. I've not decided yet how I handle rpc's requests. From the client side, server receives jsons like below.

{"method":"App1hoge", ...}
{"method":"App1fuga", ...}
{"method":"App2foo", ...}

The server side handles some applications, App1, App2, etc. So I think I should design ApplicationRule class for each class. In this case, App1Rule and App2Rule classes are needed. And I should also design ApplicationRuleManager for handle each rule. But I'm not sure how I design ApplicationRuleManager.

In general, how should I design the relationship between ApplicationRuleManager and each ApplicationRule? Strategy pattern is familiar with this case?

Any help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire