Multi module java app project structure [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am getting task(for learning new technologies) to create a facebook like project with
1. Auth (Spring Boot,Spring security, MySQL, ember.js)
2. Messaging (Spring Boot, Kafka,Cassandra, ember.js)
3. Member (Spring Boot, ember.js)
4. Reporting (Kafka, Spark, ember.js)
functional.
I need to get help for project structure. Should I have four separated modules (like auth, message, member, report) + core module. And what I should put in core module(entity beans, helpers, utils...)?
Thanks in advance.

Keeping code organized on huge projects is important, making each functionality into it's own module is desired.
But only if you are experienced enough should you begin with that. It might be better to start off in one module and expand later into separate modules.
In the core you construct tests that determine if the application as a whole is functional, etc. Core could also include the REST for everything else than the modules you already said.
Or do you plan to make the front with react?

Related

what are the benefits of using a spring-boot library instead of the core libs? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 11 months ago.
Improve this question
I need to use Kafka in my spring-boot application and I see spring-boot has its own spring-kafka library. I am new to spring and java and confused if I should be using spring-kafka or any other application's spring-based lib rather than using the core libraries and what are the benefits of either one of them.
Spring boot with Kafka comes with various autoconfiguration out-of-the-box to save you from the trouble of configuring each and everything (though you can definitely override spring-boot opinionated autoconfiguration).
So, if you want a ready-made application to work quickly, you can take the help of spring-boot and its utilities.
If your preference is configuring each and everything to gain fine control, use core libraries.
I'd say it's just a matter of choice or preference.

Sharing code between multiple micro-services [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I am developing three micro-services
View offers
Add offers(for administrator)
Opt offers
View offers is used to show offers to customer and Add offer used by service admins to link offer to customer and if offer is linked to customer, view offer will return that offer in response. Opt offers is used by customer to avail the offer.
While designing, I realized that all 3 services share same functionality, but also have their own logic.
Should I use shared code while developing these API or each API must have its own code base?
If you are using maven then you can use Maven Modules. This basically means you can extract the service code into separate module and include that module as a pom dependency in all 3 microservices.
Here's an example of how to do it using Spring. If you are not using Spring then you can have a look at another example here.

Whats the right way to separate model and logic [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Hi I'm setting up a new project and was struggeling with Java Annotations.
Are they related to Logic / API or Model
In Detail:
I have a started a multi maven module for example:
project-parent
project-model
project-persist
project-logic1
I separated model from every other module simple POJOs with JPA.
To use them with different frontends or REST etc.
Now I wanna use annotations from project-logic1 in the model.
Now i'm confused with the seperation.
Should I make an own API module (project-API) for this and similar annotation / interfaces
Should I simply add the annotation in the project-model
Should I add the dependency of project-logic1 into the project-model POM
I think the first one is correctly but I'm not sure.
From what I understand, you shouldn't use your model objects (with the JPA annotations) as DTO in your project.
You should have your model within the logic project, so DB related items are un the same place, and you create and API project with only POJO, not related to your DB, so you can use this API for REST services' answers and keep your implementation hidden.
If you have common code, I would suggest to wrap it into a dedicated module, so I would agree with your "API"-Approach (although the label "API" might be too much here).
Do not cross-reference your modules, dependencies must always go one way. And: Never repeat yourself, so c/p-ing your annotations is fundamentally wrong ;)

Difference between Vertx and Spring Boot [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Vertx and Spring both can be used to build entire REST application with many features like metrics calculation, monitoring via JMX etx.
a) What is the difference between Spring Boot and Vertx?
b) I stumbled upon an article: http://keaplogik.blogspot.in/2015/11/spring-boot-vertx-microservice-tech.html.
It describes a techstack that mixes both vertx and Spring Boot, but being new to both have not been able to figure out the usage in the mentioned link.
I am currently working on a REST application project, so I wanted to pick the correct stack before diving in.
Thanks in advance.
There is no correct (or incorrect) stacks, just stacks that fits your needs or not. In that case, either one is good. My personal preference goes for vertx, but you should try both and make your own opinion.
Both documentation is good, so take few hours on each, experiment, and choose based on your own experience.

Modularity - design patterns - Architecture [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm trying to implement modularity system (J2EE) to allow changes of the type modules/plugins/add ons.
I want to know how to start, what approach I should follow.
Are there any new design patterns for this type of system ?
or do I need a new technology (message bus, osgi) ?
Thanks in advance
Mhadjis
Spring would be a good starting point. Spring context files let you specify most of the architecture in XML and the replace them later. This makes for a very modular architecture. Now in terms of being able to write "plugins" like where a user can provide a jar file and it hooks into the app dynamically that is something you'd have to roll yourself. However, Spring could help you there again by providing a lot of tools for abstracting out the configuration of plugins and loading them (loading them as Spring contexts).

Categories

Resources