Eran Medan
Eran Medan

Reputation: 45735

Is there a library / repository / public site that contains commonly written Java Entities / Classes / Beans / Data structures? (Preferably in Java)

We all reuse our code, but really, how many times did you find yourself re-writing something like this?

class Person{ 
    private String firtsName;
    private String lastName;
    private Date dob;
    ...
    private List<Address> addresses

or this

class Address { 
    private String address1;
    private String address2;
    private String city;
    private String zip;
    ...

Wouldn't it be nice if we had a library of free, mature, well written, best practice Entity types / beans / POJOs / POCOs so we all can finally say good bye to trying to clone the world in Java / C# / (replace with your favorite language) and start writing actual code.

Is there something like that? Do you agree it's required?

Upvotes: 0

Views: 87

Answers (3)

Victor Sorokin
Victor Sorokin

Reputation: 11996

There's mvnrepository.com which contains tons of Java code of different nature. The most difficult part of you asking is done there -- central, searchable repository of Java code which is used by lots of developers and is "common practice".

I don't know if there's some library with purpose similar to what you interested in. But if there isn't you can always write it and share it with the world via given link.

Upvotes: 1

niksvp
niksvp

Reputation: 5563

Are you looking something similar to this.

The Skyway is an open source tool which does generate the code to your needs that helps you to save your redundant typing of JAVA code.

Upvotes: 1

Stephen C
Stephen C

Reputation: 718826

Is there something like that?

I've heard of no such library.

Do you agree it's required?

No, I don't.

There are so many possible ways that you could write domain objects like this (depending on the business requirements), that organizing such a library would be a nightmare.

Besides, this kind of object typically consists of just getters and setters, and can be written very quickly ... or even generated from a model ... so you save very little time / effort by using a library.

(By contrast, the kind of classes you find in typical reusable class libraries are much more complicated, and much more difficult to write from scratch.)

Having said that, I think there is justification for reuse of this kind of thing on a larger scale; e.g. off-the-shelf components or systems for managing customer databases, or website account details.

Upvotes: 2

Related Questions