正致力于通过REST API(Java/Spring/JSON)访问遗留代码(Java).
本质上,我们的遗留代码有许多命令处理器类型类(接收命令)并将数据提供给调用者.因此,我们有许多命令处理器,其中包含许多方法.每种方法都类似于GET/POST数据,即getCustomer/getCustomers/addCustomer等.
我们讨论了两个选项:
选项1 - 为每个操作创建端点.
选项2 - 创建一个单一的REST端点并传入通用有效负载.传入的JSON将具有"类型"标识符,在端点中我们可以"构造"require对象类型
我认为选项#1是一个更好的设计,因为它更简单,更加坚持REST.我不喜欢选项#2,因为单个端点现在实际上就像一个花哨的前端控制器或调度程序,然后要么包含一个巨大的switch语句.
我有兴趣看到你们的想法,优点/缺点.
I'm using Angular v8 and Angular Materials. In particular mat-tab-group and mat-tab. I want to have something like the below. I want to be able to click on the "+" (which looks like a tab) and the result would be that it would create a new tab
After clicking on the "+" we'd see as below (focus is on the new tab we just added)
If I have a button above the mat-tab-group (which adds a new tab) all works …