The paradigm of annotations [closed] - symfony

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

Related

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

Spring MVC - Project structure - best practices [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 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.

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

What is 'System Usage Specification'? [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 6 years ago.
Improve this question
My software is a video-audio converter and video cutter. I have used Qt(compiled from source) and ffmpeg (compiled from source). I have to prepare System Usage Specification outline and Specify Usage patterns of the system and indicate it using Run charts / Histograms. I am told to use Winrunner for this purpose. I don't know exactly what to do. Please help.
I never heard about 'System Usage Specification', this must be a terminology specific to your company.
A wild guess would be that it's something close to the Use Case diagram of UML, to define what the users can do and which action they have to perform to lead them to the expected result.
Sounds like a uggly word for "handbook" or "usage guide" from the pov of a end-user (though I never heared of that specific term)

Resources