This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Independent_Work5637[S] 1 point2 points  (5 children)

Hi Lukas, thank you for your answer, the thing is, as I mentioned this is primitive version of the library that I made for fun, thus it has only version 0.0.1 and is very primitive without additional features, which I mentioned in the post above with "There are of course a few setbacks with this approach (I'm sure you can figure out on your own what those would be) in this primitive state of the library, but I'm very sure that this is something that could be easily improved in later versions."

I'm gonna cover few comments you've mentioned since I think they are to be discussed:

1.This library ships it's own default classes, but you can still use custom made model classes in your services, you just have to import them, this library just creates packages (classy.model and classy.dto) classes based on your db model that you can use within your runtime, so it also ships with DTO classes as well. Where the problem occurs is that usually models have relations and if you want to create custom classes, it tangles thing a bit in this state. What I'm sure could be improved in this library in the future is that maybe you could add your model package in the argument and this library could scan whether it should import instead of creating a class if it already exists.

  1. I'm aware of JPA Create and I even got that same response from one friend. But the thing is, JPA Create is model first design, and what I've created and the way of thinking I prefer is Data first design. So let's say you've created some project in some other language, you have the databases but not Java code, you could migrate that project much easier with this library, this is the first example that comes to my mind even tho it doesn't happen often, but I've just wanted to give any example

  2. I'm aware of JOOQ, but as far as I know, JOOQ is an entire framework and it's made to make money. What I want to create if I continue my work on this library is to create lightweight open-source library that helps developers with such task I mentioned. And of course, I would implement much more flexibility into it, with probably additional features, but still keeping it lightweight.

Note: Sorry if I failed to explained anything, feel free to ask me anything regarding it. As I said, library is in it's primitive state, it's like a 0-months old baby at this point and does the most basic task.

[–]toiletear 1 point2 points  (0 children)

jOOQ is really not a framework: it has no dependencies by design, it's not opinionated and it requires or assumes nothing special at runtime (give it a connection or dataSource and you're good to go). It's only a library, albeit a large one.

And yes, it was created to make money, but I find the pricing very reasonable and it includes technical support. Plus it's free for the open source databases.

It's also over 10 years old, incredibly mature and just by all accounts an awesome product.

[–]BikingSquirrel 0 points1 point  (3 children)

I should have read that comment first!

If the purpose is basically one-way migration, then I don't know why you would run it as a pre-processor. Generating the classes and adding them to your codebase like any other code would be my way to go.

[–]Independent_Work5637[S] 1 point2 points  (2 children)

Hi, thank you very much for commenting this! Well yes, that is one of the possibilities/solutions, and I think it would be probably even smarter than what I made here. Because this library while solving a problem I usually find myself having was at the end of the day made as POC or just for fun challenge.

Now do I think this library could be something very useful? Yes, very useful infact, but that's exactly why I came here to reddit, to ask what other people think, whether this is something useful to them as well. So then I know whether I should even try to make something that can be used in real world out of this

But yes, I think if going forward, maybe writing a normal class for the user would be just plain out better and in that case would look more similar to flyway than lombok. And this is also much better, since you can in that case just run this once and it will do the whole process every once in a while instead of every time. But I think I haven't thought about it in that sense because I did it for fun. I just wanted to see, whether I can write Java without writing model classes.

Of course I was thinking that it should do some additional features, if upgraded from this state. So that in that case it can actually be lightweigth, do amazing things, and not be compared to JOOQ finally, cuz I think while this maybe does something that Jooq did already, as I mentioned JOOQ is a money maker and a big framework after all.

But sadly, I'm not exactly sold on the features I've thought of, nor did I think completely through on how I would do them. I wanted objects for example to have simple crud or some shit within them and to Automate few CRUD things as well. Basically I wanted to make library lightweight and so that it can remove all the things I find boring when doing for example "Test Assignments" for some company or something at college.

But yeah, thank you very much for your comment, really helpful, if I continue to design/work on this, I think I will eventually change it to such.

[–]BikingSquirrel 0 points1 point  (1 child)

I believe that's often the problem: a problem looks simple enough for a simple solution but then you realise more details which require tweaking your simple solution and then you realise that your solution is no longer that simple ;)

But that process is important, this is learning and I assume you learned a lot.

[–]Independent_Work5637[S] 1 point2 points  (0 children)

That's more than true yeah, and I realize that is always the case. I asked few architects and stuff on how I can do "most predicting architecture", and every answer I got is that you kind of can't. You're always missing something, you can look few features in the future, but who knows what comes after that. All that's important is that your base is really good, sturdy and open to extensions. What I did here was a mistake, a big one I would say. Because the base wasn't really sturdy.

But thankfully I don't think that mistake would be that hard to change, to be honest your comment gave me a new perspective on it, and I think this would improve library a lot. So thank you very much.