3 ms·
Java beans was just convention. Enterprise Java Beans was a mistake which probably contributed to Java's bad rap for a while. But you could use an app server wi
by abraxas 2y ago
Java beans was just convention. Enterprise Java Beans was a mistake which probably contributed to Java's bad rap for a while. But you could use an app server without EJB just fine. I did for years and never had problems.
As for rmi, when Java was in its heyday the most popular protocol for remote api handling was SOAP. But when RESTful era arrived Java tooling adapted very quickly and it made little difference what you were using to call outside the app server.
- agumonkey 2y agoand what kind of library / ide plugin is used to call rest api in a type safe manner without writing boilerplate ?
- mike_hearn 2y agoMost frameworks will do that? In Micronaut it's something like this on the client: @Validated public interface PetOperations { @Post @SingleResult Publisher<Pet> save(@NotBlank String name, @Min(1L) int age); } then you inject @Client("https://example.com/pets") @Inject PetOperations pets; and call its methods. It will use the annotations to validate the call client side before sending it, and you can implement the same interface on the server: @Controller("/pets") public class PetController implements PetOperations { @Override @SingleResult public Publisher<Pet> save(String name, int age) { Pet pet = new Pet(); pet.setName(name); pet.setAge(age); // save to database or something return Mono.just(pet); } } where the same validations will occur before the call is accepted.
- bitwize 2y agoJavaBeans and EJB became things because Microsoft was eating everyone's lunch with their component paradigm, COM, on the client side and were making inroads into server-side enterprise computing as well. With COM, you could write components that just plugged right in to an application, in any language. Java, despite being ostensibly object-oriented all the way down, didn't have an answer for this until JavaBeans emerged and then EJB for the server side. You have to remember that Microsoft had a relentless focus on developers building stuff on top of their platform. That image of Steve Ballmer sweating like a mule and chanting "Developers! Developers! Developers!" wasn't just a meme, it was an indicator of the entire company's direction. Nobody could match them at the time. From Internet Explorer to Visual Studio, 70%-80% of Microsoft's monopoly was built in simply outcompeting everyone else. If people were locked into Windows, it was because it just made sense from a business standpoint. But yeah, I built business apps with just Tomcat and no J2EE components and it was fine.