Can you make use of AOP with Ninject 2? - aop

I'm trying to find examples on the web of how to use AOP via Ninject. Can someone confirm if AOP is available in Ninject 2 without using external libraries (i.e. Castle Windsor?).
If it can be done, could you post a link to resources that would help me get started?

Yes, use the Interception extension:
https://github.com/ninject/ninject.extensions.interception
http://www.google.ch/search?client=firefox-a&rls=org.mozilla%3Aen-GB%3Aofficial&channel=s&hl=de&source=hp&biw=1330&bih=813&q=Ninject.Extensions.Interception&btnG=Google-Suche

Related

Quarkus Jax-rs clients with external interfaces

I started playing around with Quarkus and its REST client. According to the documentation a Jax-RS annotated interface should be created and annotated further with #RegisterRestClient.
My issue is that I already have the JaxRS interfaces for the services I need to connect to, in an artifact provided by the server, which I can just import. Is there a way to use an already created external Jax-RS interface to create a service with? It seems so wrong to copy-paste the code for a perfectly good interface, when it has been so nicely served for me.
There's RestClientBuilder, which allows programmatic usage of JAX-RS interfaces. Assuming the JAX-RS interface is called HelloClient, you can do this:
HelloClient client = RestClientBuilder.newBuilder()
.baseUri(URI.create("http://localhost:8080"))
.build(HelloClient.class);

Platform-agnostic web framework in kotlin

I am looking for framework, that has some basic framework tools like routing, templates and possibly some other tools useful for web (but also other types of apps), that are not dependent on platform (ex. nodejs/java). I don't see reason why this has to be 100% platform specific. If there's routing and generic request/response object, there can be implementation for example both for node express or for example java servlets with correct mapping and wrappers. Has anyone tried to do that yet? I couldn't find anything.
You may want to take a look at Ktor.

Generating documentation for a Datasnap RESTful API

I've been looking for a way to include an auto-generated documentation endpoint to an existing Delphi Datasnap RESTful API.
Can it be done? Are there annotations or external tools I can use?
Where would I begin, how would I proceed? If not from within Delphi itself, can I integrate with e.g. Swagger?
It seems somewhat anachronistic to build a RESTful API without offering a documentation endpoint these days...
Any and all information that could help me in the right direction would be greatly appreciated.
Using Swagger, via YAML has just been added to Delphi through EMS, the latest RESTful API development option in Delphi.
https://delphiaball.co.uk/2016/04/22/swagger-yaml-delphi/
Its based on Attributes that are added to the API end points as they are defined and that in turn creates the YAML to import into Swagger.

Creating a RESTful WebService without using Jersey or any other libs

okay you might say its a duplicate of this.
It might be but the answer is still yet to be found.
Isn't there any way we can make a RESTful web service without using jersey or for that matter any other libs?
I am searching for the past 5 days for the answer to this question!!
You should be able to accomplish this with servlets.
Create a servlet for each service or url that you expose to your service consumers.
Eg. For a user CRUD service, create a UserServlet and specify the mapping as /user/*.
Consumers of your service, will hit urls such as
http://yourdomain.com/user
http://yourdomain.com/user/23
for various RESTful operations.
Inside of the servlet, you should be able to extract the request parameters, form data, request headers and context information.
For a detailed discussion on how to design your restful api and best practices, search "Restful API Design". Here are a couple of links to get you started
https://blog.apigee.com/detail/api_design_third_edition_video_slides
https://blog.apigee.com/detail/slides_for_restful_api_design_second_edition_webinar/
If you want to use JAX-RS, which is a specification, you must use an implementation of this specification. Jersey is the Reference Implementation of JAX-RS but any other implementation is fine, too.
You can write a service with a RESTFul interface using plain Servlets. But why reinvent the wheel? You really don't want to do this. But if you must, read the Java EE Tutorial on Servlets. But a Servlet will not be RESTFul without further work. You can easily fall into the trap of writing a RPC-style service.

Selecting an IoC container for asp.net webapi

I am looking for an ioc container to use for asp.net webapi. Couple of the key feature we are looking for are as follow
Custom lifetimes
Built-in support for web request lifetime
Good integration with web api in terms of manage the dependency registration.
Mark Seemann knows his DI/Ioc and has an article on implementing it for Wep Api with Castle Windsor here. I don't know about custom lifetimes but it definitely solves the second and third requirements.
Castle is not as lightweight as say Autofac but it's been around for years and is tried and tested: I am using Castle for my Web Api and Mvc projects without issue so far.
Both should do the job though.
I personally like Unity. The reason why I use Unity is that it is build by Microsoft and with that you can expect that it is nearly up-to-date. Also I had prior experience with it and it has good support for ASP.NET Web API, but the final choice for or against a container is up to you. It really dependent on personal flavor.
There's a small part in the ASP.NET tutorials which talks about using Unity with Web API.