简体   繁体   中英

C# Class Library or Web API

I have an ASP.NET MVC 5 Web Application that talks to an AS400 backend system. I made calls to AS400 Programs through IBM iSeries Client Access Library

Which way is correct

a) Create a class library with all functionalities and reference through my Web Application or

b) Create a Web API, make a reference to the class library and host it to IIS

I think this is a better solution because it would be in another application in IIS and not in the same process as in the first approach. I will be more asynchronous. I'm right?

I used both a and b in same system(as400 and .net), but for different cases. If you want to isolate as400 things from your application, then go with web api(b). This will give you more flexibility to work(maintain wise). And this way good if you have many functions with deal with. This will also make your life complex. Like security...

I used case a, when I just need to do only a login through as400 and few more things.

Usability with other applications

a) You can reference that dll to many other applications(.net only)

b) You can use api for almost any type of application

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM