How To Send a Complex Object to a Rest Web Service?

What is your favourite technology stack for web development?

  • Hey! Right now I'm developing web applications with PHP + SQL (MySQL, PostgreSQL), XML, JavaScript (Ajax, jQuery) and all the HTML/CSS stuff. Most of the time I use the typical XAMPP installation (Apache/PHP/MySQL). Recently I'm working a lot with webservices mainly with SOAP and REST. With PHP I heavily use object oriented design and design patterns (Gang of Four, POSA...). My applications are based on the MVC pattern and I know the php frameworks Zend, CodeIgniter and Symfony. I worked a lot with Wordpress and Typo3 (also wrote extensions). So I know a lot about PHP. But I'm really thinking about switching on the server side from PHP to something new. I'm not totally happy with performance of PHP. It's OK, but it is not fast as hell. PHP applications often seem inert. Does it make sense to change the server language, or is it a better idea to use more AJAX? For the data base I'll give a NoSQL data base a try. Maybe Mongo. Because I'm a computer student, I'm totally open to every programming language. I have some knowledge in C/C++, Java (JEE 7, Spring, and Android, also made fully functional Apps), Python, Matlab/Octave, VB.Net, Prolog and many more. So my knowledge is quite broad, but not deep enough to judge which is the best option for a real world scenario. I only used this languages and environments for university purpose. I really like the classical object oriented paradigma (also strongly typed languages). So C++ and Java seem to be good options. I also like the syntax of this two. This is one big disadvantage for me with Python. I'm not a big fan of the indentation style... another option is Node.js but I'm not really into JavaScript (maybe this is just because of a lack of knowledge) So what would you suggest to use, if you would have to implement a SaaS (Software as a Service) Web Application from scratch? There should be a balance between performance and code maintainability/quality (continous integration, test driven development, code metrics etc). So I don't want to sacrifice everything for performance. Is PHP ok? Is Java (with/without JEE7 or Spring) the way to go? Is there some C++ Framework to use? Is Node.js the best option? Or something different (Ruby, Groovy)? Thank you for all your tips ;-) PS: I don't want to start a language war. I just want to hear experience reports from some real world projects.

  • Answer:

    You're right in saying that PHP is not fast as hell, but unless you're building an application with thousands of users or something high scale of the like, then you're not going to notice a difference. It really depends on how fast you want the web application to be built. Seeing as you already know PHP, you should be able to develop an application fastest in PHP. Do you like writing PHP? Yes? Great! Keep doing that. No? Great! That's why many other languages exist. Trying something new is never a bad thing, but it's also not a best vs. worst option for the most part when it comes to web programming. If you've got the time to spare and an itch to learn, I say to hell with the "best" option, just learn something new and expand the dimensions of your thinking.

Sam Jesso at Quora Visit the source

Was this solution helpful to you?

Other answers

It's better to take the route of dynamic/scripting languages when building a product at it's initial stages. Since time is the most critical factor, the decision makes sense. Just pick a language you're comfortable with. If you're experimenting, then the tech stack does not really matter. However, if you are infact building a real world product, then I suggest you choose the stack you're most comfortable with, to reduce the time taken to build/test/release new features.

Kiran Gangadharan

What you are looking for is performance and not new server side programming language. When it comes to web applications then most languages more or less offer approximately same performance. If you have doubt over PHP's performance ability then have a look at Facebook. Facebook with more than a billion users is built using PHP (LAMP) stack. So you have world's biggest POC available with you to verify that PHP application can be real fast. What you really need is an efficient architecture for the application. Follow web application architectural guidelines and you will be saved from lots of hidden performance issues. In general, when you change a programming language, you are actually changing the ecosystem. This new ecosystem will solve tooling problems if you. It will provide you with ready to go frameworks. It may help you solve programming problem with ease that are otherwise not so trivial in other language. Take python and C++ for example. What you do with C++ code can easily be achieved in python in just one line (Take file reading-writing operations). With new language, you might be able to reduce the amount of code you write and so the time-to-market period. But, this new language will come with its own issues of performance. In one word, it really does not makes sense to change the server side language just for the sake of performance. However, if you really think that your current PHP code is not upto mark and there is nothing that can be done, then it is time for you to change your entire approach to development. NodeJS for example is radically different way of doing server side code. Traditional server programming is synchronous i.e. blocking whereas NodeJS is based on async nature i.e. non-blocking server request. I have seen projects making use of NodeJS. But they have not really used the async API provided by Node resulting in applications that function similar to what was there previously. So honestly, it is a programming error and not the problem with NodeJS. And then, I have also seen applications that are truly making use of async nature of Node where the gain were really substantial. The work that was being done by ten server was now done by just six servers. So it is quite an achievement. Further, same can be applied to the database system. However, here you have a clear choice choice to make between SQL databases i.e. RDBMS and NoSQL databases. Each of these databases serve different purposes. Ideally it is better to use SQL databases for structured data where you can apply principles of normalization etc. while NoSQL databases are better suited for unstructured data. Unstructured data tends to have redundancy. Search Google for detailed explanation. Note this that don't use any technology stack just because it is trending or everyone is using it. I personally love PHP language and it is indeed a beatiful language...

Harshal Patil

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.