This is an attempt to make www.welovecoding.com a better place...
MySQL
- Database: welovecoding
- User: welovecoding
- Password: 123456
- Host: localhost
LESS preprocessor
Istallation
- Install NodeJS
- On command line: npm install -g less
- Add lessc.cmd (for Windows) to the LESS path in NetBeans: C:\Users\username\AppData\Roaming\npm\lessc.cmd
Project configuration:
- Input: /WEB-INF/frontend/less
- Output: ../resources/META-INF/resources/css/generated
CoffeeScript
Everyhting that is getting raw data from our database or a third party API and maps that data into entities of our own structure is called a Repository.
A Service uses entities (given by a Repository) and provides them in a sorted, filtered or unfiltered way so that they can be used by a Controller. A Controller is then used to provide the requested data for a view (JSF page).
Every self-contained big feature (called an "epic") has it's own package, like com.welovecoding.blog
. A package of an "epic" consists of the main packages: data
, view
and api
(api
is optional). The view
package is used to keep classes that are used for view-related operations (like our Controllers). In the data
package you can find all classes that are needed to retrieve and map data (like our Repositories & Services). The classes themselves belong to context specific packages inside the main packages.
Here is an example for a possible "blog post" which a part of the context of a "blog" module:
com.welovecoding.blog.data.post.PostEntity
com.welovecoding.blog.data.post.PostRepository
com.welovecoding.blog.data.post.PostService
com.welovecoding.blog.view.post.PostController
com.welovecoding.blog.api.post.PostResource
In our example a blog post entity can have embedded entities. If that is the case and if there are multiple entities, then we will add an extra package inside the data.post
package.
Example
com.welovecoding.blog.data.post.entity.PostEntity
com.welovecoding.blog.data.post.entity.LanguageEntity
com.welovecoding.blog.data.post.entity.TagEntity
Java
- Generating a JavaServer Faces 2.x CRUD Application from a Database
- From database to RESTful web service to HTML5 in FIVE minutes
- How to use a JEE Filter to secure JSF 2 application resources
- Composite Components In JSF 2.0
- GZip Compression for JEE Web Application
- Good JavaDoc source code example
Mobile Web Apps
Rules & Conventions
- Apache Maven: Guide to naming conventions
- Should package names be singular or plural?
- Which XHTML files do I need to put in /WEB-INF and which not?
- New JSF 2.2 namespaces <- At the moment we should use THE OLD namespaces (reason)
- How to Write Doc Comments for the Javadoc Tool
- GitHub keywords for commit messages
UI & UX
- Bean Scopes
- Managed Bean types
- JSF Standard Context Params
- Communication in JSF 2.0
- Maven Default Lifecycle Phases
- Javac XLint Options
- Jenkins: Build on Git-Tags
##Cool projects:##
- Apache Isis™
- Pebble - A lightweight, open source, Java EE blogging tool
- Project Lombok, Project Lombok & JEE
- Pure CSS modules
##Website Analyzer:##
- SEO tools
- http://developers.google.com/speed/pagespeed/insights/?url=wwww.welovecoding.com&tab=desktop
- http://validator.w3.org/check?uri=wwww.welovecoding.com
- http://tools.quicksprout.com/analyze/www.welovecoding.com
- SEO Tools from OnPage.org
- Load testing from the cloud (free credits)
##REST service##
##Lessons learned##
- Avoid using component bindings to a bean that has session scope
- Never assign FacesContext as instance variable of a view/session/application scoped managed bean, because the FacesContext instance is request scoped
- h:commandButton is not working
Always strive to make code that can be modified with the least number of edits. - Lea Verou Optimize only as needed. - Adam Bien