|
by via Mobile Web Weekly
"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
|
Want to incorporate Instagram Stories into your marketing? Wondering how other businesses are using Stories? Instagram Stories let you engage your customers and prospects with a more complete message than a single image can provide. In this article, you’ll discover four ways to use Instagram Stories for business. Why Instagram Stories? Instagram Stories lifts its [...]
This post 4 Ways to Use Instagram Stories for Business first appeared on .
- Your Guide to the Social Media Jungle
I recently found myself architecting yet another microservices REST backend. Within the past few years I've written from-scratch backends in Spring, Dropwizard and even in Python using web.py but each has left me wanting more. In this article I’ll show how and why I settled on Spring Boot and JDBI as a combination of frameworks which allows me to easily develop REST services backed by a relational datastore.
Let’s compare and contrast some of the modern REST frameworks that can be used today in order to build REST services. There are some obvious ones missing (e.g. Ruby on Rails, Flask, Django, NodeJS) but I’m going to focus on the frameworks that I’ve personally used to build significant production-grade service tiers.
The grandaddy of modern microservices backends, Spring has great dependency injection (DI) and a large extensive library of addons, but it tends to have long startup time and feels quite heavy and enterprisey when compared to some of the newer microservices frameworks. Spring.io itself recently posted this good article drawing out some of the concerns they’ve heard from developers regarding the Spring framework.
It also features out of the box support for Hibernate as an ORM layer, which (feel free to flame me in the comments) in my experience gets in the way as often as it doesn't. It's great for simple relational structures and is quick to bootstrap solutions but as soon as you're dealing with complex data structures or want specific types of queries (say for efficiency) it becomes quite cumbersome.
A light-weight Jersey container which provides great support for JDBI as an ORM-light solution. I've found JDBI to be a simple way to interact with a DB. Yes, you have to bind your ResultSet
s to your model objects manually but I've found it a small price to pay for the great flexibility it provides by allowing me to generate the exact queries I want without having to rely on (and trust) SQL auto-generated by an ORM. In my opinion it's a really nice solution that sits somewhere between JDBC and a full-blown ORM.
What Dropwizard doesn't do well is DI. There is support for Guice via extensions like dropwizard-guice but I have found these to be clunky at best. My biggest issue with all of these solutions is that you end up with separate DI graphs for each module. This isn't a problem for simple applications but I've experienced in complex applications that dropwizard-guice becomes quite unwieldy and the separate DI graphs end up having the same class being injected with a different instance/state which can start producing unintended results.
I really just want out of the box DI that is easy to use and gets out of the way. This should be plumbing, not an application feature.
Well, clearly one of these things is not like the other. I included web.py because I have written a full-featured rest tier in it and if your religion is Python then it's a good choice. If you're actually contemplating a Java-based framework then this obviously isn't your cup of tea.
Spring Boot is a lightweight version of Spring that is focussed on creating Spring-like applications that "just run". If you're new to Spring Boot there are some excellent getting started guides in the Spring Boot reference guide.
Whereas Spring can feel quite enterprisey, Spring Boot both feels and performs like a true first-class microservices framework due to it’s quick learning curve and snappy startup. It has the same great support for DI as Spring and also features an extensive library of spring-boot-starter-*
maven dependencies that you can use to add support for a great many things.
It still, however, uses Hibernate as it's "native" ORM tier. Now if that's fine for you then go for it, Spring Boot out of the box is a great solution but for me I just find Hibernate too cumbersome.
I've stated that Hibernate "gets in the way" and that JDBI is "a really nice solution", which bears further discussion to draw out a few points. Firstly, there are many Hibernate applications which operate well at scale (and I have developed many), however, there is very much a trend to move away from heavy ORM solutions for some of the following reasons:
This quora post is an excellent discussion that reinforces some of the points I make above and also touches on others. Note that I am not trying to hate on Hibernate here. It’s a good tool and when configured correctly can have great performance in a number of situations (I have personally written high scale solutions using Hibernate as the ORM).
So this certainly isn't a right-or-wrong discussion and I do not want to suggest that JBDI is the cure to all evils. But it is an alternative to a "heavy" ORM like Hibernate and can make your life easier as a developer. I have personally encountered many tech companies which are happily using JDBI inside Dropwizard and would not move back to using Hibernate.
So what's a savvy software engineer to do?
Continue reading %Combining Spring Boot and JDBI%
Time is the most important asset an entrepreneur can have, but it can seem like there aren’t enough hours in the day. Even if you sit at your desk for 12 hours straight, if you’re not using this time efficiently, you’re going to end the day feeling unaccomplished.
For most people, the morning is the most important time of day ⏤ your actions in the morning set the tone for the rest of the day. Unfortunately, most of us wake up feeling stressed, tired and overwhelmed by the endless number of tasks on our to-do lists. This negative mindset at the beginning of the day will only set you up for failure.
Having a positive start to the day will ensure that the rest of your day follows suit. Even if you’re not really a morning person (honestly, who is though?), simply having a routine in place can be the difference between a wasted day and a creative day. Being organized decreases stress and leaves your mind clearer in the morning, ready to work on those ideas you already have and generate more.
Here are 7 morning rituals to kickstart your creative productivity!
Getting active in the morning is one of the best things you can do for creativity. Whether you go for a run, squeeze in a few yoga poses, or you do some quick push ups, you’re breaking that dreaded cycle of waking up and traveling to work ⏤ the excitement of doing something active (or just something different) can lead to more creative insights. Vogue’s Anna Wintour plays tennis for an hour almost every morning at exactly 5:45!
Scientifically, exercise also encourages creativity in our minds by helping the blood flow to our brains and releasing endorphins, a neurotransmitter that leaves you feeling euphoric. A happy person is a creative person!
You may be one of those “wash the night before” types who would rather stay in bed for an extra 30 minutes, but what if showering in the morning could make you more creative?
Having a hot shower in the morning not only gives you that energy-boosting wake-up call, but it also releases dopamine, another neurotransmitter that increases our adrenaline and creativity. When we get in a hot shower it relaxes us and we become absent-minded to a degree, soaking up the pleasure we feel from the warm water.
This relaxed state of mind encourages the release of dopamine and gets our creative ideas flowing.
Alternatively, if you're brave enough, cold and contrast (hot for 2-3 minutes then cold for 1 minute and repeat) showers have also been suggested to boost creativity.
When cold water is poured onto our bodies, we get a shock and a rush of adrenaline. We take in more oxygen to try to warm ourselves and our heart rate also increases. This results in blood rushing through our bodies and giving us that energy boost and invigorated feeling we need to start the day with a buzz.
Our interactions and experiences with the environment around us is what fuels us creatively, and inspires us, but sometimes we’re too overwhelmed and anxious to take notice of it. One type of meditation can change that.
Continue reading %7 Morning Rituals to Kickstart Your Creative Productivity%
In Angular 1, components are the mechanism which allows you to create your own custom HTML elements. This has been possible with Angular directives in the past, but components build on the various improvements that have been made to Angular and enforce best practices in how they are built and designed.
[author_more]
In this article, we're going to dig into the design of components and how to put them to use inside of your applications. If you haven't already started to use components in Angular 1, you can read about their syntax and design in one of our recent tutorials. My goal is to outline some best practices that will improve the quality of your application.
It should also be noted that many of the best practices of Angular 2 are brought into Angular 1 through the new components API, allowing you to build applications that are more easily refactored later. Angular 2 has influenced the way that we think about and design Angular 1 components, but there are still a number of distinct differences. Angular 1 is still a very powerful tool for building applications, so I believe it is worthwhile to invest in improving your applications with components even if you aren't planning or ready to migrate to Angular 2.
Components should be designed with a number of key characteristics in mind to make them a powerful building block for your application. We'll dig into each of these in more detail, but here are the primary concepts components should adhere to.
Now let's start by looking at why and how components should be isolated and encapsulated from the rest of the application.
The evolution of Angular 1 capabilities has been to enable isolated and encapsulated components, and for good reason. Some of the early applications were highly coupled with the use of $scope
and nested controllers. Originally Angular didn't provide a solution, but now it does.
Good components do not expose their internal logic. Thanks to the way they are designed, this is pretty easy to accomplish. However, resist any temptation to abuse components by using $scope
unless absolutely necessary, such as emitting/broadcasting events.
Components should take on a single role. This is important for testability, reusability, and simplicity. It is better to make additional components rather than overload a single one. This doesn't mean you won't have larger or more complex components, it simply means each component should remain focused on its primary job.
I've classified components into four primary groups based on their role in the application to help you think about how you design your components. There is no different syntax to build these different types of components — it is just important to consider the specific role a component takes.
These types are based on my 5+ years of Angular experience. You may choose to organize slightly differently, but the underlying concept is to ensure your components have a clear role.
There can be only one app component that acts like the root of your application. You can think of it like having only one component in the body of your web application, and all other logic is loaded through it.
<body>
<app></app>
</body>
This is recommended primarily for Angular 2 design parity, so it will be easier to migrate some day should you wish. It also helps with testing by moving all of the the root content of your application into a single component, instead of having some of it in the index.html
file. The app component also gives you a place to do app instantiation so you don't have to do it in the app run
method, enhancing testability and decreasing reliance upon $rootScope
.
This component should be as simple as possible. It probably will contain just a template and not contain any bindings or a controller if possible. It does not replace ng-app
or the need to bootstrap your application, however.
In the past, we've linked controllers and templates in a ui-router state (or ngRoute route). Now it is possible to link a route directly to a component, so the component is still the place in which a controller and template are paired, but with the benefit of being also routable.
Continue reading %A Guide to Building Quality Angular 1.5 Components%