Is it really a problem to mix Backend (BE) and Frontend (FE)?
Yes, it is a problem, it's simply wrong. Some of you will argue with me and say:
- I'm doing both: FE and BE and I'm 'pro' in both areas.
- Our FE developers learned Domino platform in few weeks, so we have no problems, they feel comfortable with doing stuff with IBM Designer.
- Our FE guys simply say what to change and we do that, they send us some template each time we need to change something.
- We are doing internal website and our internal employee do not care about speed, modern UI etc.
I believe some of you are really perfect in both areas: FE and BE and you have enough time to improve skills in both areas just in time, so you don't follow practice that 10 years old. Honestly, at some point I thought I was good enough in both areas (FE and BE) to do modern stuff, however more I worked with web more I realized that my skills FE is not good enough to build really modern, fast and easy maintained web application. I spent years before I gave up and said to myself: I'm quite good in BE and I'm not bad in FE and that's actually enough, after that life became a bit more easy :).
Where is a problem?
Let's take an example when new FE developer joint to the team and he got tasks to change some UI.
1. Classic example (mail9.ntf, form memo)
Problems:
- almost impossible to deal with that if you are not skilled in Domino;
- have to know @Formula language to change <Compute Values> or hidden formulas;
- have to know that fields might have some properties (classes, styles, id etc);
- should ask for help each time they need to change UI;
2. xPages example (discussion9.ntf)
Problems:
- more skill required about Domino, Java, SSJS and xPages especially;
- controls will generate HTML automatically and it is a problem for our team as we aiming for 100% control;
- as it's even more complicated, potentially FE will ask to involve BE developers each time they need to chagne UI.
If we split BE and FE then what?
Then life become much easier :), application will get better structure, things will go faster. How to do that? In our case we found template framework
The Apache Velocity Project and tested it enough to make sure it would cover our needs. Then we started to move out UI from logic step by step, and yes, that process took months but once we did it we started to receive benefits immediately.
Today we keep UI (HTML templates, CSS, JS) as files and our FE guys use
GitHub. They are free to create new templates and organize their structure. They have huge freedom (compare to what they had 2 years ago) of how to do their job. There are really a lot of documentation +
stackoverflow.com that can help. However Velcoity itself is quite intuitive and simple framework.
Wanna see 'Hello world' example?
In example bellow we pass 2 items to template (HashMap<String, String> map equal to Dim mylist List as String in LotusScript) then Velocity engine does rest of work and return result. In our project we simply pass all fields from document to template so FE guys have freedom and ability to work independently. It's really easy, proven by our FE guys.
HashMap<String, String> map = new HashMap<String, String>();
map.put("name", "Velocity");
map.put("author", "Joker");
velocity.applyVelocityTemplate("hello.world", map)
+++
## Velocity Template; id 'hello.world'
<html>
<body>
## our hello world example
Hello $name World!
$author
</body>
</html>
||
\/
<html>
<body>
Hello Velocity World!
Joker
</body>
</html>
Summary
Split and manage!
Other articles in this series
- How we build our web applications based on Domino
- Split back-end and front-end areas, they should not block each other and be independent as much as it is possible.
- Front-end guys should not have any knowledge about Domino, they don't need IBM Designer installed at all.
- Back-end guys must have knowledge about Domino, however they don't need to use IBM Designer, only in very rare cases. Backend should be done using only Java (no LS/SSJS/@Formula etc)
- Using Git+Jira is must and Jenkins server as builder server
- Auto-tests.