AJAX or a server side framework? - zend-framework

I am working with a friend on building a web site, in general this web site will be a custom web app along with a very custom social network type of thing..
Currently I have a mock-up site that uses simple PHP with AJAX and JSON and JQUERY and I love how it works, I love the way it all fits together.
But for a mock-up I did not implement any of the Social Network design patterns such as a login, rating, groups etc..
This brought me to a higher level of decision making requirement, I need to decide if I want to develop all this functionality by hand or use some kind of a framework.
I spent this entire day researching, and it would seem that using Drupal and such frameworks will make the Social Network part easy (overlooking the customization requirement for now..) but will make client side Web App development less so.
I found some other frameworks that are more developer friendly (customizable) such as Zend and Symfony etc.. but these seem to take allot of the power from the client and implement it in the server side, to me this seems a waste (and an unjustified performance bottleneck) ..
Finally I found Aptana Jaxer framework that seems to think the same way I feel.
That said it seems a bit under-developed, I didn't find modules for a social network and the community around it seems thin.. (searching Jaxer in StackOverflow returns few results)
So other then making server side DB comm a bit simpler it does not help me greatly..
My requirements are a good facility to develop web apps on while containing all the user centric logic usually used for social networks in advance.
What would you recommend?
EDIT:
OK, lats fine tune this question, after considering this abit further, is there a good down loadable source of a social network site in PHP that I can work around in building my web app? (I really like using JQUERY AJAX JSON etc..)

if you want to develop a social networking site from scratch, i recommend using zend-framework as a server side framework and jquery as a client side framework.
they have a lot of library which you can use such as zend_auth,zend_acl for user authentication system and Zend_Search_Lucene for search facilities and zend_gdata for youtube videos and so on.
but you can also use one of the several social networking engines available out there.
here is a link:
http://www.best-php-scripts.com/social_networking.htm

I think it depends on the goal your trying to achieve.
Personally, I tend to like to keep things simple and to decouple complex
things in smaller components, so it's easy to stay in control when you'll
incrementally add new features.
Ajax or a server-side framework ? I'd say that they're not necessary overlapping
each others. However some (server-side) frameworks tends to wrap everything in a
single zipped package to make things easier for beginners. I personally don't
like this avenue because it will make your web app dependable on this framework.
Thus, nothing prevents you to use one client-side framework for the presentation
logic and another one for server-side/business logic.
Hth,
Etienne

Related

PWA - Progressive Web Applications Architectures

I been look into things about PWA (link: https://www.youtube.com/watch?v=LaS_5jUeh_0) and it does mention something called "App Shell Architecture",
My Uncertainties:
Can Progressive Web Applications support other Architectures such as MVC? or in order to implement PWA feature we need to change our Legacy Architecture to the Architecture that design for PWA?
Is it possible for us to continue use the Architecture that we are comfortable (in my case: MVC architecture) to implement PWA?
I'm migrating an MVC, Razor heavy app to be more PWA like, ultimately I want it full PWA with offline capability but there are a lot of things I need to change before I get there however hardly any of it requires changes to the existing MVC code!
The key factor, to answer your question, is building in MVC will not prevent you building a PWA and if you're happy with that architecture then carry on using it.
What matters more is how your pages are rendered (particularly if you want to go full offline) a heavy Razor based site for example will I think make life a lot more tricky, especially if you have dynamic elements on the page that rely on callbacks to the server.
So the first thing I'm doing is moving a lot of my functionality into the Javascript and uploading all the page data up front as JSON. Then I can have things happen dynamically with a lot less reliance on the sever.
Obviously saving and updating data still relies on the server and I've not got to that point yet, in terms of how to handle things in offline mode.
If it helps my starting point was to reduce callbacks to the server to the bare minimum required, once I get there then I'll know what I have left to deal with, including all the Razor pages!
You can use MVC to build a PWA. App shell is nothing but the skeleton of your page which you use to load your content. That has nothing to do with whether you use MVC or not. It is recommended and easy if you use SPA for PWA which make the app shell cachin easy. Again there is no hard rule. If you follow the recommendations, it will make your life easier.. recommendations are made for a reason!

Choosing a framework for both app and website [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
There is an old php base website which provides a single service and is working for many years. Now we have decided to change the website itself to become more modern and faster and at the same time providing an app for it and we are going to hire some people for that. As I'm a developer myself (a c++/go fan and mostly in machine learning area) I want to know what are the best options to choose when such thing is needed. I personally think that the whole back-end should work as a RESTful API and then probably something like react and react-native in front for both web and mobile but I'm not sure if this is the best decision we can make.
I want to know what other people with same requirements have done ? Some people recommended us meteor but it seems to be changing very fast and we really need some stable and mature solution without too much maintenance.
Looking forward to hearing your suggestions
I'm a big fan of the REST API + front-end JS framework architecture.
One option would be to build an API with Ruby on Rails. The "rails generate new" command includes an --api option for generating a Rails application that lacks views and serves JSON. You can learn more about building APIs with Rails on the rails-api gem GitHub page. (Keep in mind the rails-api gem has since been rolled into Rails proper.)
Overall, Rails is a fast way to get a services layer up and running. It's fairly simple, and might be a good option for your app, which as you said, provides just one service. However, Rails is also powerful enough to support a much more substantial API.
If you want a REALLY simple Ruby-based services layer, you should check out Sinatra. You could also go full Javascript with Express. It's about as simple as Sinatra.
If you have a background with C++ and Go, you may not want to jump headfirst into these web-heavy technologies. Consider using Java Spring for your services layer. (I would link but I don't have enough rep. Haha)
As far as the front-end goes, you're on the right track with React and Meteor. I'm personally a fan of Angular (specifically Angular 2). It's a really popular JS web app framework -- great for asynchronous Javascript and single page applications. Granted, Angular has a steep learning curve to start, but if you're willing to climb, it pays off.
Let me know if you have any specific questions! Good luck.
Meteor is a bit heavy if all you want is a web site. It depends how much interactivity you want - if it's more of an app, then it's worthwhile doing, and if you want to do ios and android apps, then Meteor is pretty fast to get up and running.
I would recommend to choose a technology that either you are keen to learn, or you have some skills in already. Learning curves mean longer projects.
If you need native mobile application and interactive site than react and react-native with pure API server is a really good solution. I developed several similar services and very satisfied with this combination.
First of all you can share API access layer and part of business logic between both clients.
Second you are using identical technologies on mobile and web. However mobile application has real native UI because React Native don't use browser.
Thirdly server becomes more simple, maintainable and scalable.
Personally I prefer WebSockets as network protocol (look at amazing Go gorilla websocket implementation). But if you need support old browsers or prefer more classic REST API than it's ok also.
Answering based on my comment above, this is all opinionated, but I find that Node/JavaScript tends to be about the best bang for the buck, if all you are trying to do is get through proof of concept stage, and possibly scaling from there. Depending on your back-end needs, you may want to migrate parts, or whole to Go or Python.
On the Front end, using web tooling (mostly centered around node and npm), I would build the primary UI with React and the material-ui components... Targeting a web/browser interface... you can then extend this, in order to support more native-like features. You can build "native" versions using Cordova for Android and iOS. You can use electron as a base for desktop versions.
For the backend, node is a nice place to start, and I feel RethinkDB is a great database for many use cases (despite the changes from commercial to open platform happening now). Mongo is another option, and there are hosted/managed options through a few providers. Alternatively, I'd probably lean towards PostgreSQL via Amazon.
The API server, I'd definitely do a first pass with Node, and then, as needed rewrite whole, or in parts with Go or Python... Go will have better performance and scale without compromising some of the ease of development aspects. Python has very rich tooling, if you need more flexibility than performance for some areas. There are other options, C# is becoming a very good cross-platform option, which I happen to really appreciate as a language. The performance there is very good, though you may find some constraints less appealing than JS or Python.
YMMV with any of these choices.

Framework for enterprise application

I have been developing a plain JSP/Servlet web application, which focuses mainly in collecting large sets of data through JSPs, processing them and finally commiting them to a MySQL database. Imagine something like a declaration of assets for a pretty big number of people.
While it works pretty good now, the code is really jumbled up and since I now have the time, I am thinking of completely redesigning the whole application in a more sophisticated and reusable way. My main problem is that forms are built mainly through jQuery (my form_build.js and form_validate.js files span over 600 lines each at the moment), and the back-end java code is jumbled up since there is massive use of name[counter] input fields.
I.e. The user can add 5 assets in the form, where he has to submit something like 30 fields of information on each one. The form sends them in the form of attribute[asset_counter].
If I managed to make myself clear, I have been looking into the Google web toolkit - which I had no idea of before - and from what I gather mastering it will take some time for me. Is it worth the trouble, or is it aimed at something completely different? And is there a framework or technique that can handle efficiently what I need?
Frankly, I am a senior java developer and I used a lot of jsp/jsf web applications accompanied by EJB, webservice, simple spring web apps, and I recently came up to use GWT.
It's a very nice platform, it has the following advantages:
All the code is compiled to html/JS which is better in terms speed
and browser understanding agilty
It uses built in JSON xml transer (nice approach)
It use built in AJAX (nice approach)
It use it's own cleint server platform (no need to use other
libraries for each one)
It will adopt to any browser (strong competetor)
drowbacks:
Sometimes it takes time to load in the browser (specially when using
FlexTables)
I advise you to use it!
GWT is a very powerful toolkit, and from what I understand it might help you to better organize you client side code. But you also have to consider some high-level JS framework like backbone.js+require.js or Google Closure. Time spent to learn this frameworks this bascially the same as for GWT, the choice basically depends on what your team prefer, JS or Java. In most cases when logic on client side gets very complicated, I will choose GWT.

Create CRUD web app with Dreamweaver or other framework?

Background: I have created a CRUD web app using a java based RAD tool called Wavemaker. I am considering developing the app again in a framework that has greater support. Even though I have some experience in development I still get confused by all of the terms. My understanding is that there are languages (C#, PHP, Javascript, Java, etc), frameworks (Wavemaker, Ruby on Rails, Yii, Symfony, Code Igniter, Zend, etc) and editors (Dreamweaver?)?
I outsourced the development of a mobile version of my web app and this was created using jquery mobile, php and ajax. I started using Dreamweaver because I read it had integration for development with jquery mobile and hence I could perform modifications on my mobile app.
I was wondering whether Dreamweaver was a viable choice for the development of a CRUD web app? I used dreamweaver many years ago for the create of html pages and it would automatically create a lot of "unclean" code that made it hard to maintain. I fear that I would put myself in a similar situation here with server-side code.
If Dreamweaver is not appropriate could you kindly suggest a framework that may meet my requirements?
The main things I liked about Wavemaker:
Drag and drop widgets
A lot of the database functions were automatically handled
The main things I don't like about developing with Wavemaker (not Wavemaker itself):
Support: The support generally involves posting to the forums and hoping for a reply that may never come. I would rather paid support over this option which to be fair is offered by vmware but I found it too confusing.
Small number of freelance contractors: Much of the functionality within my app required coding or workarounds outside of the standard features of wavemaker and it is very hard to find a freelance wavemaker developer for help
Ongoing bugs that cause a headache during development
With that being said my priorities are:
Support: great documentation with rapid response to problems (even if this requires a paid subscription)
A large number of freelance contractors available (I guess this means a popular framework using a popular language).
Simple and easy to use (I understand there would be an initial learning curve)
Stable: I won't be running into bugs that hold up my development and need me to wait for the next release for a fix
The ability to incorporate reporting like BIRT reports or Jasper.
Possibly steer clear of Java as I have found Tomcat to be an extra level of complication that it would be great to do without.
Any help would be greatly appreciated.
Thanks.
Dreamweaver was a viable choice for the development of a CRUD web app?
Yes, but with caveats. It still does not produce code that advanced users would consider "clean" but the integration of JQuery Mobile in CS5.5 makes it a good choice for non-coders or beginning coders who need to spin up rapidly and will worry about elegance later.
That being said, if you are outsourcing the design it is likely that the code you get back will be editable in Dreamweaver but not written in such a way as to take advantage of Dreamweaver's built-in behaviors (automatic code writing). Dreamweaver expects to see code written to its specs in order to take over for the user. If not, it is still a great wysiwyg editor and above-average code editor.
But it's not a framework. In your sitution, JQuery Mobile is the framework and any JQuery Mobile developer should be able to step in and run with the project. But if you write big chunks of the CRUD using Dreamweaver, developers may tell you that they will want to rewrite those sections. Some won't care.

Cafeteria Management System as a project. What should I use?

This is a part of my course project.
Basically, there are vendors which provide food and at peak hours the queue gets so large that people have to wait long for their order.
Our project is like an online site which will enable users to order food. After ordering the food, the user will get an info as to where does he lie in the queue. This way students can order from their hostel rooms without actually going to the vendor and getting their time wasted by waiting in the line. As soon as the user orders the food, vendor gets notified of the project so that he can start preparing the food.
I am completely new to web development so I am not sure what to use. This project will also work as an exercise to learn about web development.
I have heard about Drupal & Joomla CMS. Also, Django framework is also there and I am actually confused as to what technology to use.
I am also confused as to what is the difference between a framework and a CMS? How do they differ and which one will suit me.
So, how do I go about developing the
application?
A framework is a basic application without any concrete business logic. It contains basic structure and sometimes basic features (like database connectivity and other standard libraries). You have to write your code yourself.
A CMS is a content management system. It is essentially a complete website but without the content. it provides tools to write content (web pages). The most popular ones (like Joomla) come with a bunch of templates too that you can download to give your site any look you want.
A CMS probably doesn't have enough features to provide you with this logic. You will probably need to do some programming to get this done. It may still be useful to use a CMS, though. Lots of them support various plugins that allow you to add these kind of features and still allow you to easily edit regular pages.
Frameworks are libraries turned on their heads. You plug a library into your code; a framework turns this around by abstracting a particular problem in such a way that you plug your code into it to solve a problem. It's the Hollywood principle: "Don't call us; we'll call you."
People who write frameworks have deep knowledge of a particular problem domain. They usually represent the distillation of several attempts to solve a problem, with best practices, clear abstractions, and good plug-in points made clear from long experience.
Django is a Python framework for web applications that have a browser front end and relational databases for persistence.
That's one example of a framework.
A CMS (Content Management System) allows users to dynamically add and manage content in a web application. I think they solve slightly different problems from Django, because it is specialized to the problem of content management.
I'd recommend starting your queuing problem without a front end at all - just text. Concentrate on the subtleties of queuing. Get that right with your object model and then expose a user interface to display it to users.
CMS is a 'content management system'. If provides modules that you can plug in. The end effect is it sets up a website for you, and you have admin pages where you can enter content. For special stuff, you use plugins. If you have to, you can write your own plugins.
A development framework is just a stack of technologies you can use to develop an application. So for example, the Grails framework uses Hibernate(persistence) and Spring(dependency injection and other stuff) under the covers -- it is providing and using existing tools (which are themselves frameworks) which you will in turn use to build the application.
With a framework, you basically start with a bunch of tools in your toolbox, but little or no parts of a running web app out of the box. You have to develop the functionality with the tools. With a CMS system, it's like they have implemented something for you, but it is really generic and you will have to tailor it to your needs.