Articles

There exists two types of synchronisation techniques to make sure you avoid concurrency issues and race conditions when updating database records. These are as follows.

  • Optimistic locking
  • Pessimistic locking

Optimistic locking is usually performed by using native database mechanism such as RowVersion in SQL Server, TimeStamp in MySQL, or ETag in Cosmos DB. These are special field types that changes automatically as the record is updated, allowing you to inject the values of these fields as a criteria to your update invocations. For an example of how this works, imagine the following schema.

Source de l’article sur DZONE

Hello Muleys,

You might have quite often encountered a situation where you need to have dynamic « keys » in a key-value pair.

Source de l’article sur DZONE

Dark themes are everywhere these days. 

As human beings continue to spend more of their time interacting with technology, dark themes provide a more relaxing way to engage with the digital world. More often than not, these themes are easier on the eyes, more attractive, and perfect for the dedicated user

Throughout 2020, countless leading brands have debuted their own version of the dark theme. Google has a solution for your Drive, while Apple and Android have built dark theme performance right into their operating systems. 

If you haven’t learned how to make the most out of dark mode yet, then you could be missing out on an excellent opportunity to differentiate your design skills, and earn more clients going forward. 

Why Dark Mode?

Before we dive too deeply into the possibilities of creating your own dark theme, let’s examine what dark mode is, and why it’s so effective. 

Ultimately, dark themes are created to reduce the amount of luminance emitted by everything from your desktop and laptop, to your smartphone and smartwatch. Dark themes help to improve the visual ergonomics of design, by reducing eye strain, adjusting brightness to suit current lighting conditions, and more. Additionally, many dark mode offerings are also fantastic at conserving battery life. 

Here are some of the main benefits of adding dark themes to your design portfolio

  • Better user experience: A focus on user experience is one of the most important trends of the digital age. You need to be willing to deliver incredible experiences to everyone who visits your website if you want to stand out today. Dark mode reduces everything from eye strain, to battery power consumption. This helps to keep customers on a website for longer.
  • Innovation and cutting edge appeal: Most companies want to prove that they can stay on the cutting edge of their industry. The ability to offer an opt-in dark mode version of a website theme or appearance can help your clients to stand out from the crowd. As the environment becomes more mobile-focused, more companies will be looking for designers that can provide the best mobile experiences. 
  • Support for universal design: Dark mode isn’t just great for people who have light sensitivity at night. This solution could be more comfortable for visually-impaired users who would struggle with eye strain when visiting your websites otherwise. If you want your content to be more inclusive for a wider range of viewers, then learning how to design for dark mode is a good way to start.

Best Practices When Designing for Dark Mode

Designing for dark mode is easier than you’d think. Most of the time, it involves simply thinking about how you can replace some of the brighter, more overwhelming aspects of your site, with something deeper and darker. 

Here are some useful tips that will get you moving in the right direction. 

1. Experiment with Colors

A big issue for a lot of web designers when it comes to developing a dark mode solution is that they get too caught up with things like pure white text against pure black backgrounds. However, this high-contrast option can be a little much after a while. 

It’s often much easier to use a dark grey as your primary surface color, instead of a true black. Additionally, rather than using bright white, think about slightly off-white alternatives that will be warmer to the eye.

Experiment with surfaces and color combinations that are unlikely to cause too much eye strain. Dark grey foundations often offer a wider range of depth, too, because you can demonstrate shadows on grey. 

Additionally, when you are experimenting with colors, remember that saturated colors often vibrate painfully against very dark surfaces, making them harder to read. Desaturating your colors will help to reduce the contrast and make your websites more welcoming. 

Lighter tones in the 200-50 range will have better readability on dark themes. However, you can always experiment with your choices. Google Material Design recommends using a contrast level of around 15:8:1 between your background and text. 

2. Consider the Emotional Impact

Much of the effort involved with dark mode design is figuring out how certain colors work together. It’s easy to get carried away with stark contrasts, particularly when you’re used to working with a white background. However, you need to remember that you’re designing for a user that’s primarily looking for an easier and more subdued browsing experience.

While you’re working, remember to consider the emotional aspect of the design too. The emotion in colors can make or break a buyer’s journey in any environment. However, an often overlooked-aspect of color psychology, is that people perceive shades differently when they’re on a black background

For instance, think of the color green. On a light background, it conveys nature and even financial wealth. However, on a dark background, the same green could come across as something venomous, toxic, or even sickly. It’s important to think about the kind of impressions end users are going to get when they arrive on your site.

3. Give Users the Freedom to Choose

One of the biggest mistakes you can make when you begin designing for dark mode, is thinking that you should focus entirely on your dark themes, and nothing else. This lines you up for a problem if you interact with users who want the best of both worlds. If you’re designing for apps in particular, you’re going to need web pages that can switch naturally between light and dark themes. 

Learning how to implement both a dark mode and a light mode option into the desks you create will help you to reach a wider selection of customers. Remember, you’ll need to test the performance and impact of your designs in both themes, to check that they deliver the same kind of experience, no matter how your user chooses to browse. 

Although dark mode should offer a different experience to end-users, it still needs to feel as though they’re browsing on the same website. That means that you’re going to need to experiment with the most natural combination of light and dark mode options.

4. Remember the Basics

Remember, although the three tips above will help you to get on the right path for dark mode design, you’ll also need to consider the opportunities and limitations of the platforms that you’re designing for. The kind of dark mode experience you can deliver for Google Chrome websites is going to be very different to what you can create for something running on iOS.

Examining the documentation provided by the system that you’re designing for will help you to develop something with a close insight into what’s actually possible. 

Other top tips for dark mode design include:

  • Focus on your content: Make sure that your content stands out on the page, without being too overwhelming. 
  • Test your design: In both light and dark appearances, you need to make sure everything is working as it should be.
  • Adopt vibrancy for your interfaces: Vibrancy helps to improve the contrast between your background and foreground. 
  • Use semantic colors: Semantic colors adapt to the current appearance of a website automatically. Hard-coded color values that don’t adapt can seem more aggressive. 
  • Desktop tinting: Try experiment with things like transparency and filters to give your websites and apps a slightly warmer tint – ideal for late-night browsing
  • Icons: Use individual glyphs and icons for dark and light modes if necessary. 

Ready to Design for Dark Mode?

Preparing your web development and design portfolio for an era addicted to dark mode can be a complex experience. You need to think carefully about how people are going to browse through your websites and apps when they’re searching for something more subtle, and less visually overwhelming than the websites that we’re used to making. 

The most important thing to remember is that everything on your website or application should look just as beautifully tailor-made in dark mode as it does in light mode. Simply adding a dynamic black background when people want to switch settings in an app isn’t enough. You need to go in-depth with your designs and examine how different fonts, colors, and images work together.

Source


Source de l’article sur Webdesignerdepot

Designing for emotion in and of itself is not a problem. Websites are bound to elicit an emotional reaction from visitors, even if it’s as simple as them feeling at ease because of the soft, pastel color palette you’ve designed the site with.

I don’t want to outright villainize emotional design. Unless there is some form of unethical manipulation at play, designing for your visitors’ emotions can actually provide them with a more positive experience.

So, here’s what I’d like to look at today:

  1. What is emotional design?
  2. When does emotional design cross a line?
  3. What’s the right way to design for emotions?

1. What Is Emotional Design?

When we look at emotional design in the context of a website, we’re focused on three types of emotional reactions:

a. Visceral Reactions

Visceral reactions are instinctive ones. Usually, visitors experience these as their first impressions of a website or web page. For instance, a cluttered or otherwise poorly designed homepage might leave visitors feeling overwhelmed, hesitant, or wanting to flea.

A minimally designed homepage interface, on the other hand, might have visitors not feeling much of a reaction at all. In this case, no feeling is a good feeling.

Like Irene Au said:

b. Behavioral Reactions

Behavioral reactions stem from the usability of a website. There’s a lot that can stir up negative emotions here, like:

  • Extra-long contact forms
  • Confusing menus
  • Error-ridden content
  • Slow-loading pages
  • And more

Again, if a website is easy to get through and attractively designed, visitors aren’t likely going to “ooh” and “aah” with every step they take on the site. And that’s a good thing. If they’re focusing more on how the design looks, they’re not paying attention to the brand’s actual offer.

c. Reflective Reactions

Reflective reactions are the third type of emotions we design for.

This is complicated because there’s a lot wrapped up in how visitors feel about a website after the fact. Sometimes the most well-designed interfaces and experiences can’t save them from a bad experience, whether they realized too late that the products were overpriced or they were treated poorly by a live chat representative.

As a web designer, all you can really do is to make sure you’re working with reputable companies and then aligning the designs of their sites with their values.

When Does Emotional Design Cross a Line?

There’s already enough social pressure online; your website doesn’t need to be one of those places, too

Emotional design shouldn’t be about manipulating consumers’ emotions. In most cases, emotional design is about controlling the environment of the website so that emotions don’t go spinning wildly out of control — in either direction.

It’s when we take what we know about influencing someone’s emotional state to monetarily benefit from it that emotional design becomes problematic.

Here are some ways in which you might negatively impact the emotions of your visitors through design:

FOMO

The fear-of-missing-out isn’t always a bad marketing strategy. However, when FOMO is used for the purposes of rushing consumers to take action now and without time to really think it through, it definitely can be.

Chances are good they’ll feel badly no matter what. Either because they regret the rushed (and probably unnecessary, or expensive) decision or they blame themselves for missing out on an opportunity to be like everyone else.

There’s already enough social pressure online; your website doesn’t need to be one of those places, too. So, be careful with how you present customers with limits (on time, on products, etc.) or how you frame the call-to-action (“If you don’t buy this now, expect to fail/be miserable/suffer even more”).

Analysis Paralysis

It doesn’t matter why people specifically seek out your website. They have a problem or a hole in their life, and they’re looking for something to fix it.

Now, you can’t help it if the website has too much to offer in the way of options or solutions. Companies have to provide every possible solution/option so their users don’t feel like they have to go somewhere else to get what they need. However, the way you design these options can lead to a negative emotional state if you’re not careful.

For instance, your visitors might experience analysis paralysis, where there are so many options that it becomes impossible to take action. Similar to FOMO, this can lead to regret either with the decision they made or the one they were incapable of making.

By simplifying how many choices are presented at once, or designing a clear and supportive pathway to the right option of many, your website will leave visitors feeling much more positively about the whole experience.

Trendy Nostalgia

Nostalgia can be a great way to play upon the positive associations and emotions consumers feel towards an era gone by or a place they once knew. But, again, it depends on how you design with it.

For example, if you design a vintage website for an agency launched in 2019 and run by a group of 20-somethings, it might come off feeling disingenuous once customers start to catch on.

For a restaurant known as the oldest bar in the state, that would be a different story. That nostalgically designed website would be a real part of its story; not just done as a sales gimmick. As a result, customers would likely embrace those warm feelings for the “good ol’ days” they get from the website.

Also, think about how quickly nostalgia fades if it’s done to align with a trend. Unless you’re committed to redesigning a website the second that nostalgic feeling falls out of favor, you could be condemning your client to an outdated website mere months after launch.

What’s the Right Way to Design for Emotions?

Like I said before, there’s nothing wrong with designing for emotions. You just have to make sure your website visitors don’t feel manipulated and that they welcome the pleasant feelings the site gives them.

make sure your website visitors don’t feel manipulated

It might seem harmless at the time. After all, what are they doing on the site if they weren’t interested in the first place? And it’s not like they were bullied into spending their money, right?

But if they sense in any way that their response was driven by an emotion they wouldn’t have otherwise felt, they’re not going to be happy. While it might not be enough for them to cancel their subscription or services, or to return products they bought, it will definitely leave a bad taste in their mouth. And, ultimately, it can cost your website loyal visitors and customers.

So, if you’re going to use emotional design on a website, do it to improve their experience, not to put more money into your clients’ pockets. That means your emotional design choices need to be honest, transparent, and focused on eliciting naturally positive emotions like:

  • Satisfaction
  • Feeling impressed
  • Trust
  • Calm
  • Feeling valued

Go back to the three emotional reactions I brought up earlier. If you can design a website to give off a positive first impression, and to be pain-free and usable, you can spend the rest of your time injecting small bits of happiness and positivity into the website with color choices, friendly micro-interactions, personalized content, and more.

 

Featured image via Unsplash.

Source


Source de l’article sur Webdesignerdepot

Contentful; Webster’s Dictionary defines “contentful” as… not found. Clearly someone made up this word, but that is not necessarily a bad thing.

The world of user experience metrics is moving quickly, so new terminology is needed. Largest Contentful Paint (LCP) is one of a number of metrics measuring the render time of content on a web page.

What is Largest Contentful Paint?

Google defines LCP as “the render time of the largest content element visible within the viewport.” For what we are talking about in this blog, we will consider “content” to be an image, typically a JPEG or PNG file. In most cases, “largest” points to a hero image that is “above the fold” and is one of the first images people will notice when loading the page. Applying optimization to this largest content is critical to improving LCP.

It is probably more instructive to view LCP relative to other metrics. For example, First Contentful Paint (FCP) and Visually Complete book end LCP.

Each metric has its pros and cons, but LCP is a happy medium. LCP marks when web page loading starts to have a substantial impact on user experience.

In Google’s opinion, to provide a good user experience, LCP should occur within 2.5 seconds of when the page first starts loading. Poor values are anything greater than 4 seconds.

How Does Largest Contentful Paint Impact Lighthouse Scores and SEO?

LCP is now part of several “Core Web Vitals” scores that Google will measure in its ranking algorithm. Each of the Core Web Vitals represents a distinct facet of the user experience, is measurable in the field, and reflects the real-world experience of a critical user-centric outcome.

In the case of the overall Google Lighthouse score, LCP represents 25% weighting on the performance score of Lighthouse version 6.0. This makes LCP the most important Core Web Vitals metric in determining the performance score.

While Google has indicated that content is still the most important factor in SEO ranking, a better user experience (as measured by Core Web Vitals) will generate higher rankings in a crowded field. If there are many websites competing for the top search engine spots, then Largest Contentful Paint will play a critical factor in rankings.

How to Improve Largest Contentful Paint

Now that you know that LCP is important, what can you do to improve it by making content load faster? Google provides a number of suggestions, but the most effective technique is to optimize content for the device requesting it.

For example, a website includes an 800kb JPEG image that is intended for high resolution desktops. On a smartphone, that would be optimized down to less than 100kb, with no perceptible impact on quality. LCP can improve by more than 60% — or several seconds — through this single optimization.

Find Savings in Largest Contentful Paint by using Image Speed Test

Image Speed Test is a great tool offered by ImageEngine.io that provides an analysis of LCP improvement opportunities. Just paste in the URL of the web page you are interested in optimizing, and the test will show you:

  • Image Payload Reduction
  • Speed Index
  • Largest Contentful Paint
  • Page Load Time (Visually Complete)

It also provides a video of the web page loading with and without optimizations. Finally, it analyses each image to provide an estimate of payload savings. In this case, the “largest content” on the page is this image. With optimizations, the image payload is reduced by 94%. That delivers a huge improvement in LCP.

How Does ImageEngine Improve LCP

ImageEngine is an image content delivery network (CDN) service that makes image optimization simple. Basically, for each image on the page, the image CDN will:

  1. Detect the device model requesting the web page;
  2. Optimize the image in terms of size, compression, image format;
  3. Deliver via a CDN edge server that is geographically closest to the user.

ImageEngine improves web performance for every image on the page, including the largest. You can learn more about ImageEngine here, and also sign up for a free trial.

Best Practices: Preconnect

In addition to using an image CDN like ImageEngine, a few other best practices can improve LCP. Using the resource hints to provide a preconnect for your content can streamline the download process.

For example, putting the following link statement in the HTML will accelerate the download process. The link statement will make the browser connect to the third party as early as possible so that download can start sooner. ImageEngine’s optimizations make each image download smaller and faster, but preconnect save time in the connection phase.

Best Practices: Minimize Blocking JavaScript and CSS

When JavaScript or CSS is “blocking” it means that the browser needs to parse and execute CSS and JavaScript in order to paint the final state of the page in the viewport.

Any website today relies heavily on both JavaScript and CSS, which means that it is almost impossible to avoid some render blocking resources. On a general note: be careful with what kind of CSS and JavaScript is referenced inside the <head> element. Make sure that only the strictly necessary resources are loaded in <head>. The rest can be deferred or loaded asynchronously.

When looking to improve the LCP specifically, there are some practices worth looking into more deeply.

Inline Critical CSS

It is not an easy task, but if the browser can avoid making a request to get the CSS needed to render the critical part of the page – usually the “above the fold” part – the LCP is likely to occur earlier. Also you will avoid content shifting around and maybe even a Flash of Unstyled Content (FOUC).

The critical CSS — the CSS needed by the browser to set up the structure and important styles of the part of the page shown above the fold — should in-inlined. This inlined CSS may also refer to background images, which of course should also be served by an Image CDN.

Do Not Use JavaScript to (lazy) Load Images

Many modern browsers natively support lazy loading, without the use of JavaScript. Because images usually are heavily involved in the performance of LCP, it is best practice to leave image loading to the browser and avoid adding JavaScript in order to lazy load images.

Lazy loading driven by JavaScript will add additional latency if the browser first has to load and parse JavaScript, then wait for it to execute, and then render images. This practice will also break the pre-parser in the browser.

If an image CDN is used to optimize images, then the benefits of lazy loading become much smaller. Especially large hero images that are above the fold have a large impact on LCP and will not benefit from being lazy loaded with JavaScript. It is best not to make JavaScript a blocking issue for rendering images, but rather rely on the browser’s own ability to select which images should be lazy loaded.

 

[– This is a sponsored post on behalf of ImageEngine –]

Source


Source de l’article sur Webdesignerdepot

Most of the information we consume happens through reading, so it makes a lot of sense to pay attention to the words when designing. There are many aspects to typography, but one of the things that helped improve the quality of my design was letter-spacing.

Letter-spacing is about adding and removing space between letters. Some people confuse it with kerning, but these two are different; letter-spacing affects the whole line of text, whereas kerning adjusts the space between two individual letters at the time. Kerning is best left to type designers, besides which, unlike letter-spacing there is currently no way to control kerning in CSS.

I believe that practice and a lot of observation will change the way you treat letter-spacing in your work as well.

The Purpose of Letter-Spacing

The main purpose of letter-spacing is to improve the legibility and readability of the text. Words act differently depending on their size, color, and the background they are on. By adjusting letter-spacing to the environment you are working with you will help readers consume your information faster, and more efficiently. The fun part is that they won’t even notice it — that’s the whole point of the job.

Bear in mind that typographers think about letter-spacing and kerning when designing a typeface. It means you don’t have to apply it to all your text, but in order to have an understanding when it’s necessary, you should know some basic principles, and use good typefaces.

How Letter-Spacing Affects Legibility and Readability

The legibility and readability of your text depend on things like line-height, paragraph length, font size, typeface choice, letter-spacing, and much more. Regarding letter-spacing, if you are just getting into typography, the best thing you can do is not overuse it. What I mean by that is simply don’t make the distance between letters too big or too small; even if you think it looks good, people will struggle reading it, and that will ruin their experience.

Letter-Spacing Capital Letters

Capital letters are designed with the intention that they will appear at the beginning of a sentence or proper noun, in combination with lowercase letters. When capital letters are next to each other, the space between them is too tight. So in order to achieve better readability, space needs to be increased. This applies to both large and small font sizes.

Letter-Spacing Headlines

If you are using well designed fonts, you can be sure that they are calibrated well, and you won’t need to make any major adjustments to them. However, the problem with headlines is that at larger scales the space between letters looks unbalanced. It can be fixed by increasing or decreasing the letter-spacing value.

There are no strict rules for letter-spacing — there are a lot of typefaces and all of them require an individual approach — but if you look at how big companies like Google and Apple treat their typefaces, you can find a lot of valuable information there.

Let’s take a look at the “Roboto” and “San Francisco” typefaces (the first one is used in Material Design and the second one in Apple’s ecosystem). Headlines from 20 to 48 pixels have either a positive letter-spacing value or none. If the font size is bigger, letter-spacing becomes negative. These exact numbers are not going to work that well for other typefaces, but after trying different approaches I can state that it’s a common pattern.

I’ve tested several guidelines for letter-spacing and the one that was published by Bazen Agency works for a lot of popular typefaces. It will be a good starting point for you, but you can always apply additional adjustments:

  • H1 — 96px — -1.5%
  • H2 — 60px — -0.5%
  • H3 — 48px — 0%
  • H4 — 34px — 0.25%
  • H5 — 24px — 0%
  • H6 — 20px — 0.15%
  • Subtitle — 16px — 0.15%

If you happen to design a lot of apps or you’re planning to do that, one thing that helps me is using the default Material Design and Apple guidelines for their typefaces. They are well balanced and it saves a lot of time.

Letter-Spacing Body Text

If you ever read anything about letter-spacing, you’ve probably have seen this popular wisdom from typographer Frederic Goudy: “Anyone who would letter-space lowercase would steal sheep”. (There’s an argument that he was only referring to blackletter fonts.) Some designers took it as a hard rule and now never adjust the letter-spacing of lowercase text.

Based on my practice and by looking at the work of designers I can’t agree with Goudy, because sometimes small changes can make a big difference in how your text performs. Let’s take, for example, condensed fonts. At a small size, the letters are too close to each other, which leads to poor legibility. By increasing letter-spacing by 1.5% you will see that the text is now easier to read.

If we look at my previous example, in the guidelines for “Roboto” and “San Francisco” typefaces, letter-spacing is applied to body text; even though San Francisco has a dedicated “SF Pro Display” for headlines and “SF Pro Text” for body text, letter-spacing is still used to refine them.

There are a lot of different typefaces and a single rule doesn’t apply to all of them. Experiment with letter-spacing and do what seems right to you. There are some simple guidelines that will lead you in the right direction, especially when working with body text:

Keep in Mind Line-Height

If you have a line-height greater than 120%, most likely negative letter-spacing will lead to an unbalanced look to the paragraph. To refine it you would need to either keep it at 0% or only slightly increase it.

Light Text on Dark Background

On a dark background, white text looks overexposed and therefore letters appear too tight. To make it more legible, I would suggest you increasing letter-spacing a small amount.

General Values for Body Text

You can use the following guidelines for body text, which I have tested with several typefaces:

  • Body 1 — 16px — 0.5%
  • Body 2 — 14px — 0.25%

Letter-Spacing Captions

Unlike headlines and body text, smaller font sizes don’t have many variations in letter-spacing. It’s a common practice when a font size is lower than 13px to increase the space between letters to make it legible. But there are always exceptions (“SF Pro Text” guidelines suggest using positive letter-spacing only when a font size is 11px or below). Make sure you experiment with settings.

You can use the following values as a starting point and then edit them to what seems right to the typeface of your choice:

  • Caption — 12px — 0.5%
  • Overline — 10px — 1.5%

Final Tip

One of the things that helped me improve my skills in typography was looking at other designers and especially type foundries. By decoding their work you might notice some nuances of how they treat typography and it will help you in future projects.

Source


Source de l’article sur Webdesignerdepot

The Builder Pattern is extremely popular in Java applications. Unfortunately, it’s often misunderstood and incorrectly applied, which results to runtime errors.

Let’s remember the purpose of Builder: set only necessary fields in some object and keep remaining fields set to default values. For example, if we’re preparing a configuration object, then it’s convenient to change only the necessary parameters and keep other parameters set to default values. 

Source de l’article sur DZONE