Spring MVC - Project structure - best practices [closed] - spring-mvc

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 5 years ago.
Improve this question
What's the best approach?
1- Create multiple projects:
2- Create a single project:

I'd suggest you take a look at Spring's Project Sagan. It's the source code for their current website (http://spring.io). While they used a multi-module approach, it wasn't divided as you are suggesting. They really just pulled out some client work and kept the rest in a single module.
This site was written by the Spring team the way they would use their own tools and released as a reference application to answer questions just like this. I encourage you to take a look here: https://github.com/spring-io/sagan.

The point is to ask yourself what is the point in separation. If you are planning to run them in different containers on different servers, then it makes sense. If it is a large project, it makes sense to separate.

Related

The paradigm of annotations [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 2 years ago.
Improve this question
I'm new to Symfony and I was really surprised when I saw that very important parts of program logic are "hidden" in the annotations. Or actually in PHP comments. I understand, these annotations are used by the libraries, but is not it a bad solution overall - couldn't it be made differently? What is the logic behind that? From my prospective they make the code hard to understand, they are not processed by atom (or can I install some plugin for this?..), and it's overall strange idea. No?)
All That configuration can be stored in php/xml/yml files.
From my experience the idea of annotation is very convenient.
For example, you look at controller , and you see route (link to call controller action), data passed ( Parameter Converter).
If it is done right, you have all the important data in one place, just above your code.
Processing annotation by IDE it's a different story.
Check if there is any atom plugin for this , or change IDE that can handle this.
Personally, i'm using phpstrom , and i don't have any issue with annotations

Communication between Different programs in Different Computers (C# or Python) [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 4 years ago.
Improve this question
I'm building a program that I want to be able to exchange information with other programs running in another computer. I started using C# and a library called SimpleTCP. The main issue is that is too simple and only send and receive messages.
I'm looking for something that I can predetermine functions that one or the other can call from each other.
I looked on google and stack overflow but I was unable to find an appropriated subject to study, what should I be looking for to learn this? Thank you
The most complete protocol for what you want is gRPC. There is a learning curve but worth it in my opinion. https://github.com/grpc/grpc
There is a way but it's little bit different
Such programs like this written in tow different languages
You can make a center database between the both programs
In this situation it's very easy to communicate and receive ,send data
You can mysql ,oracl, mariadb or any Database you prefer

Correct placement of code within ASP MVC architecture? [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 8 years ago.
Improve this question
I have:
UI layer
Business Layer
Data access layer
Common code layer
When I need to, for example, perform string manipulation that is unique to the application and isn’t a candidate for common code. Where would you place this function?
Currently I have it in the controller but is does not feel right.
I would move it out of the controller but keep it within the MVC application, as it sounds like presentation logic. It could be a helper or maybe an extension method.
I would recommend you to make Common.UI, which will store all common things for Pressentation Layer in a separate project. In the future it will help you to switch between different pressentation layers and use same common features.

Can I write go library to be used from another languages? [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 8 years ago.
Improve this question
I'm writing relatively small, but not simple networking library which is going to be used at least from C,java,python,ruby and C#. Is there a way to make go bindings to the other languages the way in can be done form C? If not is there other way?
Right now, you can't write libraries in Go that can be used in other languages. Go has a runtime environment that does a lot of things (like sheduling go-routines, collecting garbage) for you. This runtime environment is written under the assumption that it controls the whole program. This assumption does not hold if Go code would be used from inside another language, as the Go library cannot influence the binary that uses it.
I imagine that a JSON service would do what you describe.
Have a look at the json test for a simple example
It wouldnt matter what languages you used to set and get data from your app

Symfony2 Service and Trait Best Practices for small chunks of code [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 8 years ago.
Improve this question
In Symfony2 (could apply to other frameworks too) are there any factually based best practices defined for when to put a small chunk of reusable code in a trait as oppose to a service (or even in a model)?
e.g. scenario:
I had a small piece of code which modified a url slightly (added a specific port based on the current environment and machine). It was used by several controllers. I was told this would be best in a trait as a service would be overkill because it was only a few lines of code and there was only one parameter being passed to the function (the url).
Symfony2 manual defines a service as:
"a generic term for any PHP object that performs a specific task."
There may be some subjective opinions here, but the question guidelines say:
Great subjective questions inspire answers that explain “why” and
“how” and Great subjective questions insist that opinion be backed up
with facts and references
And that is what I am looking for. Factual reasons why or why not to use a trait over a service for a small chunk of code.
Update
A great suggestion has been: traits aren't easy to test whereas services are

Resources