4 ms·
Not being critical, just saying that it is common/best practice to implement dependent web services and back end functionality before writing a web UI, right? N
by mark_l_watson 16y ago
Not being critical, just saying that it is common/best practice to implement dependent web services and back end functionality before writing a web UI, right? Nothing wrong with doing some prototype simple UIs, but having the back end stuff implemented and tested makes the first real UI implementation go much faster. So, they are following good development practices.
- mathgladiator 16y agoIt's the difference between building stuff bottom-up versus top-down. It all depends on the product.
- aaronblohowiak 16y agoThe product and the stability of the feature definition.
- JoelSutherland 16y ago(I work on HiFi) You're 100% right. What we're describing sounds a lot like waterfall. Here are a couple more details: * Our team of devs have collectively built over 450 websites. We know the domain well. * We also did a lot of UI design early on that guided some some of our work. That said, we didn't just design and give birth to a great API. We have iterated on a it a lot. Our clients were going on HiFi 6 months prior to the public release. We learned a lot and iterated on the API quite a bit during that period. What ended up being nice was the ability to make sweeping changes at one point (the API) that benefited the entire application. This is a huge advantage.
- StavrosK 16y agoCan you post a few more details, such as how you handled authentication, how views pass the session to the server (or do you use cookies for all that?), how the calls are being made (does each page do XHR calls and then render the results using logic itself?), etc?
- JoelSutherland 16y agoI'm not the right person to answer all of these (the post author is). I'll do my best on what I can. For permissions, there are five levels of users. System, Agency, Site Owner, Member, Public. These are hierarchical like everything else. Group members and individual users can have varying read/write/create permissions for different areas of the content tree. This is all at the API level. So someone logged in will have the same permissions whether they are browsing the frontend of the site, the administration UI or using the API. This is nice, tidy and easy to understand. As for XHR vs not... In the Admin UI, we're doing most work through the API via XHR and JS templates. On the public site of things, everything happens server side just like any other CMS.
- StavrosK 16y agoThanks, I'm just wondering because, even though this approach had fantastic advantages, there also seem to be some things which are done differently in an API. For example, the API might use OAuth after logging the user in with credentials, so this is a case where things are done differently in the two approaches. In this case, does one simply write two ways of doing things? You might also not want to let the users do things with the api that they can do on the site, or give different permissions to the site versus the API. How do you handle these things?
- KrisJordan 16y agoRe: authentication. There are three paths to authentication presently. 1) Anonymous - Anonymous is a subject in the system with explicit permissions. When no authentication is presented the system assumes you are the anonymous subject. This is the common case because most website content, for the types of websites we've seen on HiFi, are made up of entirely publicly readable content. 2) Cookie Based - We use your typical web app SHA1 hash with generated salt. Not the greatest form of authentication, susceptible to replay, but preferable to HTTP Basic. 3) HTTP Basic Based - Want to get rid of this sooner than later. Need to invest in digest but it has its problems. This is not used in the app but is useful for server-server API consumption, cURL scripts, etc. As Joel mentioned, the backend is largely XHR driven. Results are rendered primarily with an evolution of Resig's JS templates (http://ejohn.org/blog/javascript-micro-templating/ http://ejohn.org/blog/javascript-micro-templating/). When time permits we'll move to the now official jQuery templates (http://api.jquery.com/jquery.tmpl/ http://api.jquery.com/jquery.tmpl/). Most website frontends consume the API directly in template while still server-side. Some go further and leverage the API from JS/XHR to make pages more interactive.
- jamesbritt 16y ago" ... it is common/best practice to implement dependent web services and back end functionality before writing a web UI, right?" Well, there's UI-first development. http://www.sapdesignguild.org/editions/edition8/ui_first.asp http://www.sapdesignguild.org/editions/edition8/ui_first.asp "{Developers] usually create the user interface only after the underlying technical entities are available. Since the user interface sits on top of functions in the program logic and a database, why not create them early in the process and see what kind of interface will evolve? This approach inevitably leads to a user interface that mirrors database structures and to a user interaction that is determined by the flow of the program logic. It should be influenced; instead, by the way users act and think."