What is the difference between the term API in MVC vs a third party application? - api

I don't quite understand the difference between the term API in the context of MVC where you separate the view and the model controller vs interacting with a third party application like an air flight carrier.
Both are pretty much the same in that there is an API provider(the backend framework and the air flight carrier) and the difference is just the client being part of the app vs a separate app like the browser.

It sounds like you got it right: API stands for: Application Programming Interface.
The "application" can be local (imported library) or remote (server).

Related

Best method if Odoo and mobile app communication

We wanted to create a mobile app using flutter, I searched on how to connect odoo with external platforms or apps , I found there are two solutions:
The most common and standard one is to use the xmlrpc communication protocol, we did found some libraries with that name in flutter , but the problem with this is that it's a bit complicated for flutter devs that does not know how the Odoo architecture works.
The least common method is the endpoints or controllers method, basically you create endpoints in your controllers and just call it through http request from the mobile side, the problem with this method is that it's not standard and I did not see much people talk about it, I also heard that this method is for the web instead of mobile apps since the session_id of the identification is returned in the Cookies.
My question is the following, is the endpoint method good enough for mobile app? If no, are their any alternative of xmlrpc?
You can connect odoo with the flutter app using simple RESTful API requests, there are many packages in pub.dev which can help you

What do I have here? API or Web Service

I have a project for Master's Degree: design and implementation of web services for an elearning platform.
Now, I know that there are two main architectures for web services: SOAP, and REST
Now, I wanted to use REST architecture, so normally I would have something called "RESTful web services", so I started development with Django and Django Rest Framework
Now, this is the part where I get confused, Is this an API or Web Services
If it is an API, then how can I develop RESTful Web Services?
If it is both, please explain more if you could.
I'm very confused about this, and each time I try to understand, I get more confused, Please can someone clarify this to me?
An application programming interface (API) allows you to interact with a component, system, or resource. It's a very broad concept. To understand it, the emphasis should be placed on the word interface:
In computing, an interface is a shared boundary across which two or more separate components of a computer system exchange information. The exchange can be between software, computer hardware, peripheral devices, humans, and combinations of these.
When you need something from a component or you want it to do something for you, you don't just go in it and do it yourself, you "ask it" for that something or for that action by interfacing with it. The interface of the component says what it can do for you or what you can invoke from the component.
In regards to web services, you have to understand that a web service is in fact an API, because it's an interface with some component (in this case whatever is behind the web service itself: it can be a database, an application, a system, etc).
Like I said, an API is a very broad term. When you say web service, you are adding some restrictions to that term. For example, a web service is invoked over the network. Not all APIs are like this. Some API's can be exposed as libraries, or frameworks that you call directly from your code as methods or functions. So all web services are APIs, but not all APIs are web services.
If you want to build a web service, you can implement it with REST or with SOAP. There is a difference between the two (REST is an architectural style, while SOAP is a protocol), but as concepts they work the same: they provide an interface with which to interact over the network, i.e. an API. But since you are using Django, thus Python, I suggest you go the REST way, not SOAP (support for SOAP in Python isn't all that great).

How can I expose my ASP.NET Core web api to be used without http?

I know this sound strange, but please bear with me. We have a legacy desktop app (DataFlex), and we are developing a new web app. Both apps share the same business logic. We are in the process of moving the business logic to a centralized project that is exposed as an asp.net-core web api, to be used both by the desktop app and the web app.
So far, we have been able to access the new business logic project from the legacy desktop app via COM, but because maintaining interfaces and DataFlex wrapper classes is a pain, we are hoping to find an easier way.
We could access the business logic using the web api via http. But many users are still only using the desktop app, and setting up web servers for all of them is not something that can be done anytime soon. So we want to call the asp.net-core project in a way that resembles the way a web app does it, passing method calls as strings (JSON?)
Is this feasible? If so, how?

Multi Client Architecture using Azure Api

I want to build a new mobile app backend. This backend might eventually support other types of clients such as desktop or traditional web application.
In the past for multi client applications I would use this stack of technologies. SQL Server -> Entity Framework -> TCP WCF Service Endpoint -> MVC Web Application or WPF Windows Application
I know I want my mobile client to be consuming a Restful Http Web API like the types you would host in the new Azure API product. But I'm not sure if I should still do the WCF layer or not.
Couldn't all my clients consume just the Web API now? Or would it still be wise to develop the WCF service and the layer Web API on top of that?
It just doesn't seem right to be using 2 different serialization technologies at the same time.
Yes, you could replace that with Web API and create a REST API but as Tim already mentioned on his comment, that is obviously just HTTP and not all the protocols WCF supports.
Having said that, API Apps have Swagger metadata to describe what the REST URIs (endpoints) can do (e.g. methods, content types, descriptions etc.). There are a lot of Swagger SDK generators which can read the Swagger metadata and generate the code you need to consume the REST API in your application for pretty much any language out there. For Visual Studio 2013 with the latest Azure SDK, you have this capability built in as well. This is pure code generation, no tight coupling or anything, we just generate the code you were supposed to write to consume the API.

Is the WCF Web.API safe for production applications?

The WCF Web.API hasn't been incorporated into the .NET Framework as of the date of this post. Is it safe to use this library in production code or is it's only usefulness for testing at the moment ?
I'm using it in production.
Albeit it is not allowed at the moment to use it in production at your customers site.
But your customer can get the dependencies using Nuget...
And btw: Web API will be out of band release like ASP.NET MVC is.
While I personally have not implemented a production application with WCF web API, I know several people who have. I have not heard them report any issues that would cause me to question it's production readiness. That being said, WCF Web API is an open source project, so you can browse the code yourself to get a feeling for how sound the code is.