News for hackers. Stuff that matters.
Re:Rust Is Eating JavaScript by abraxas on Sunday February 16, 2025 @09:38AM (#43068377)
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.

Re:Rust Is Eating JavaScript by agumonkey on Sunday February 16, 2025 @09:47AM (#43068439)
and what kind of library / ide plugin is used to call rest api in a type safe manner without writing boilerplate ?
Re:Rust Is Eating JavaScript by mike_hearn on Sunday February 16, 2025 @12:48PM (#43069972)
Most 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.
Re:Rust Is Eating JavaScript by agumonkey on Sunday February 16, 2025 @01:32PM (#43070334)
thanks
Re:Rust Is Eating JavaScript by wiseowise on Sunday February 16, 2025 @01:37PM (#43070375)
Jesus Christ.
Re:Rust Is Eating JavaScript by bitwize on Sunday February 16, 2025 @06:26PM (#43072885)
JavaBeans 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.

Re:Rust Is Eating JavaScript by agumonkey on Tuesday February 18, 2025 @08:14AM (#43089073)
It never occured to me to link COM and J2EE RMI/EJB.
Re:Rust Is Eating JavaScript by bitwize on Tuesday February 18, 2025 @08:34AM (#43089256)
Both of them are at their core a set of conventions to make a component usable at runtime without having to know its API aforetime.