Unit-Tests sind bei der Java-Entwicklung allgegenwärtig. Und das ist gut so. Aber beim Einsatz von Java EE tun sich viele Entwickler schwer damit, ihre Applikation automatisiert zu testen. Die "Magie" der verschiedenen Frameworks macht Tests umständlich oder scheinbar überflüssig. Wer will schon ein komplettes Deployment in einen Application Server durchführen, nur um einen einfachen Unit-Test auszuführen? Und CDI und JPA werden doch wohl korrekt in der Produktionsumgebung laufen, oder?
Dieser Vortrag zeigt, dass automatische Tests von Java-EE-Anwendungen weder umständlich, noch überflüssig sind. Im Gegenteil: Fast alle Komponenten einer üblichen Java-EE-Anwendung - wie Models, Repositorys, Services, Controller oder REST-Ressourcen - können ohne großen Programmieraufwand isoliert voneinander getestet werden. Und auch für den Test des korrekten Zusammenspiels der einzelnen Spezifikationen - wie JPA, JSF, CDI, JAX-RS oder Bean Validation - gibt es Frameworks, die dem Entwickler das Leben vereinfachen.
Von "einfachen" Unit-Tests mit JUnit 5, Spock und Mockito, über leichtgewichtige Integrationstests mit Derby und Jetty, bis hin zu kompletten End-to-End-Tests mit Arquillian, Selenium und WireMock werden alle Möglichkeiten für automatisierte Tests von Java-EE-Komponenten vorgestellt. Danach gibt es keine Ausrede mehr für weniger als 100% Code Coverage!
Property-based Testing mit JUnit-QuickcheckStefan Macke
This document contains various copyrighted images and text snippets along with their sources. There are images from iStockphoto and Pixabay along with code examples from GitHub and references to software architecture topics, podcasts, and Twitter usernames. The document mixes media from multiple online sources without apparent overall theme or purpose.
Von wegen schwergewichtig - Moderne Webentwicklung mit Java EE 7Stefan Macke
Präsentation bei der Heise Developer World auf der CeBIT 2016
Folien mit Notizen: http://public.macke.it/Vortraege/CeBIT2016/StefanMacke-ModerneWebentwicklungMitJavaEE7.pdf
Bei moderner Webentwicklung denken viele Entwickler sicherlich nicht an Java...
...sondern eher an das bekannte Webframework Ruby on Rails.
Letztes Jahr wurde Ruby on Rails 10 Jahre alt.
Der Erfinder von Rails, David Heinemeier Hansson, hatte bereits 2005 ein Video veröffentlicht, das für Aufregung sorgte und Rails bekannt machte.
Darin erstellte er in 15 Minuten ein Blog-System mit Rails.
Inkl. Kommentarfunktion usw.
In der programmiererfreundlichen Sprache Ruby.
Für das Ganze benötigte er nur 133 LOC.
Mit Rails kann man also ein Blogsystem in 15 Minuten und mit nur 133 LOC erstellen.
Das nahm ich als Anlass, das Beispiel mit Java EE 7 nachzubauen.
Leider kam ich nicht so ganz an Rails ran. Und Funktionen wie Post hinzufügen fehlen auch.
Ich weiß, dass man ein Webframework nicht mit einer Programmierplattform vergleichen kann, aber ich denke, Java EE hat große Fortschritte im Bereich der Benutzbarkeit gemacht. Und das möchte ich heute vorstellen.
Beginnen wir mit dem ersten Teil der Präsentation: meiner Vorstellung.
Mein Name ist Stefan Macke.
Ich bin Softwareentwickler...
...und Softwarearchitekt...
...bei der ALTE OLDENBURGER Krankenversicherung AG...
...und Dozent – u.a. für Software-Engineering – an der PHWT.
Beide sind in Vechta zuhause...
...einer kleinen Stadt zwischen Osnabrück und Bremen.
Wir nutzen bereits mehrere Programmiersprachen, aber haben Java als Standard festgelegt. Und aktuell steigen wir in die Webentwicklung mit Java EE 7 ein.
Schauen wir uns einmal an, was Java EE eigentlich ist.
Java EE ist eine "Regenschirm-Spezifikation", die mehrere Spezifikationen zusammenfasst.
Bei Oracle konnte ich 38 Specification Requests zählen.
http://www.oracle.com/technetwork/java/javaee/tech/index.html
Dazu gehört z.B. der Zugriff auf die Datenbank...
...die Gestaltung von Weboberflächen...
...und das Querschnittsthema DI.
Anders als Java SE...
...wird Java EE in einem Container ausgeführt: dem Application Server.
Der Application Server stellt der Anwendung die gesamte Infrastruktur zur Verfügung, also z.B. Data Sources, JNDI-Lookups, CDI usw.
Darum muss sich der Entwickler nun nicht mehr selbst kümmern.
Application Server gibt es eine ganze Menge, sowohl kommerziell als auch Open Source.
Java EE war lange Zeit ein hoffnungslos überfrachtetes Framework, das gerade für Einsteiger kaum zu verstehen war. Lange Klassen und XML-Konfiguration überall.
Hier ist ein "schönes" Beispiel für eine solche Klasse (obwohl sie nicht aus Java EE stammt, sondern aus dem Spring-Framework).
Doch in Version 7 hat sich Java EE zu einem fast schon leichtgewichtigen Framework entwickelt. Und das möchte ich heute zeigen.
Unit-Tests sind bei der Java-Entwicklung allgegenwärtig. Und das ist gut so. Aber beim Einsatz von Java EE tun sich viele Entwickler schwer damit, ihre Applikation automatisiert zu testen. Die "Magie" der verschiedenen Frameworks macht Tests umständlich oder scheinbar überflüssig. Wer will schon ein komplettes Deployment in einen Application Server durchführen, nur um einen einfachen Unit-Test auszuführen? Und CDI und JPA werden doch wohl korrekt in der Produktionsumgebung laufen, oder?
Dieser Vortrag zeigt, dass automatische Tests von Java-EE-Anwendungen weder umständlich, noch überflüssig sind. Im Gegenteil: Fast alle Komponenten einer üblichen Java-EE-Anwendung - wie Models, Repositorys, Services, Controller oder REST-Ressourcen - können ohne großen Programmieraufwand isoliert voneinander getestet werden. Und auch für den Test des korrekten Zusammenspiels der einzelnen Spezifikationen - wie JPA, JSF, CDI, JAX-RS oder Bean Validation - gibt es Frameworks, die dem Entwickler das Leben vereinfachen.
Von "einfachen" Unit-Tests mit JUnit 5, Spock und Mockito, über leichtgewichtige Integrationstests mit Derby und Jetty, bis hin zu kompletten End-to-End-Tests mit Arquillian, Selenium und WireMock werden alle Möglichkeiten für automatisierte Tests von Java-EE-Komponenten vorgestellt. Danach gibt es keine Ausrede mehr für weniger als 100% Code Coverage!
Property-based Testing mit JUnit-QuickcheckStefan Macke
This document contains various copyrighted images and text snippets along with their sources. There are images from iStockphoto and Pixabay along with code examples from GitHub and references to software architecture topics, podcasts, and Twitter usernames. The document mixes media from multiple online sources without apparent overall theme or purpose.
Von wegen schwergewichtig - Moderne Webentwicklung mit Java EE 7Stefan Macke
Präsentation bei der Heise Developer World auf der CeBIT 2016
Folien mit Notizen: http://public.macke.it/Vortraege/CeBIT2016/StefanMacke-ModerneWebentwicklungMitJavaEE7.pdf
Bei moderner Webentwicklung denken viele Entwickler sicherlich nicht an Java...
...sondern eher an das bekannte Webframework Ruby on Rails.
Letztes Jahr wurde Ruby on Rails 10 Jahre alt.
Der Erfinder von Rails, David Heinemeier Hansson, hatte bereits 2005 ein Video veröffentlicht, das für Aufregung sorgte und Rails bekannt machte.
Darin erstellte er in 15 Minuten ein Blog-System mit Rails.
Inkl. Kommentarfunktion usw.
In der programmiererfreundlichen Sprache Ruby.
Für das Ganze benötigte er nur 133 LOC.
Mit Rails kann man also ein Blogsystem in 15 Minuten und mit nur 133 LOC erstellen.
Das nahm ich als Anlass, das Beispiel mit Java EE 7 nachzubauen.
Leider kam ich nicht so ganz an Rails ran. Und Funktionen wie Post hinzufügen fehlen auch.
Ich weiß, dass man ein Webframework nicht mit einer Programmierplattform vergleichen kann, aber ich denke, Java EE hat große Fortschritte im Bereich der Benutzbarkeit gemacht. Und das möchte ich heute vorstellen.
Beginnen wir mit dem ersten Teil der Präsentation: meiner Vorstellung.
Mein Name ist Stefan Macke.
Ich bin Softwareentwickler...
...und Softwarearchitekt...
...bei der ALTE OLDENBURGER Krankenversicherung AG...
...und Dozent – u.a. für Software-Engineering – an der PHWT.
Beide sind in Vechta zuhause...
...einer kleinen Stadt zwischen Osnabrück und Bremen.
Wir nutzen bereits mehrere Programmiersprachen, aber haben Java als Standard festgelegt. Und aktuell steigen wir in die Webentwicklung mit Java EE 7 ein.
Schauen wir uns einmal an, was Java EE eigentlich ist.
Java EE ist eine "Regenschirm-Spezifikation", die mehrere Spezifikationen zusammenfasst.
Bei Oracle konnte ich 38 Specification Requests zählen.
http://www.oracle.com/technetwork/java/javaee/tech/index.html
Dazu gehört z.B. der Zugriff auf die Datenbank...
...die Gestaltung von Weboberflächen...
...und das Querschnittsthema DI.
Anders als Java SE...
...wird Java EE in einem Container ausgeführt: dem Application Server.
Der Application Server stellt der Anwendung die gesamte Infrastruktur zur Verfügung, also z.B. Data Sources, JNDI-Lookups, CDI usw.
Darum muss sich der Entwickler nun nicht mehr selbst kümmern.
Application Server gibt es eine ganze Menge, sowohl kommerziell als auch Open Source.
Java EE war lange Zeit ein hoffnungslos überfrachtetes Framework, das gerade für Einsteiger kaum zu verstehen war. Lange Klassen und XML-Konfiguration überall.
Hier ist ein "schönes" Beispiel für eine solche Klasse (obwohl sie nicht aus Java EE stammt, sondern aus dem Spring-Framework).
Doch in Version 7 hat sich Java EE zu einem fast schon leichtgewichtigen Framework entwickelt. Und das möchte ich heute zeigen.
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
Creative operations teams expect increased AI use in 2024. Currently, over half of tasks are not AI-enabled, but this is expected to decrease in the coming year. ChatGPT is the most popular AI tool currently. Business leaders are more actively exploring AI benefits than individual contributors. Most respondents do not believe AI will impact workforce size in 2024. However, some inhibitions still exist around AI accuracy and lack of understanding. Creatives primarily want to use AI to save time on mundane tasks and boost productivity.
Organizational culture includes values, norms, systems, symbols, language, assumptions, beliefs, and habits that influence employee behaviors and how people interpret those behaviors. It is important because culture can help or hinder a company's success. Some key aspects of Netflix's culture that help it achieve results include hiring smartly so every position has stars, focusing on attitude over just aptitude, and having a strict policy against peacocks, whiners, and jerks.
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
PepsiCo provided a safe harbor statement noting that any forward-looking statements are based on currently available information and are subject to risks and uncertainties. It also provided information on non-GAAP measures and directing readers to its website for disclosure and reconciliation. The document then discussed PepsiCo's business overview, including that it is a global beverage and convenient food company with iconic brands, $91 billion in net revenue in 2023, and nearly $14 billion in core operating profit. It operates through a divisional structure with a focus on local consumers.
Content Methodology: A Best Practices Report (Webinar)contently
This document provides an overview of content methodology best practices. It defines content methodology as establishing objectives, KPIs, and a culture of continuous learning and iteration. An effective methodology focuses on connecting with audiences, creating optimal content, and optimizing processes. It also discusses why a methodology is needed due to the competitive landscape, proliferation of channels, and opportunities for improvement. Components of an effective methodology include defining objectives and KPIs, audience analysis, identifying opportunities, and evaluating resources. The document concludes with recommendations around creating a content plan, testing and optimizing content over 90 days.
How to Prepare For a Successful Job Search for 2024Albert Qian
The document provides guidance on preparing a job search for 2024. It discusses the state of the job market, focusing on growth in AI and healthcare but also continued layoffs. It recommends figuring out what you want to do by researching interests and skills, then conducting informational interviews. The job search should involve building a personal brand on LinkedIn, actively applying to jobs, tailoring resumes and interviews, maintaining job hunting as a habit, and continuing self-improvement. Once hired, the document advises setting new goals and keeping skills and networking active in case of future opportunities.
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
The document provides career advice for getting into the tech field, including:
- Doing projects and internships in college to build a portfolio.
- Learning about different roles and technologies through industry research.
- Contributing to open source projects to build experience and network.
- Developing a personal brand through a website and social media presence.
- Networking through events, communities, and finding a mentor.
- Practicing interviews through mock interviews and whiteboarding coding questions.
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
1. Core updates from Google periodically change how its algorithms assess and rank websites and pages. This can impact rankings through shifts in user intent, site quality issues being caught up to, world events influencing queries, and overhauls to search like the E-A-T framework.
2. There are many possible user intents beyond just transactional, navigational and informational. Identifying intent shifts is important during core updates. Sites may need to optimize for new intents through different content types and sections.
3. Responding effectively to core updates requires analyzing "before and after" data to understand changes, identifying new intents or page types, and ensuring content matches appropriate intents across video, images, knowledge graphs and more.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
2024 State of Marketing Report – by HubspotMarius Sescu
https://www.hubspot.com/state-of-marketing
· Scaling relationships and proving ROI
· Social media is the place for search, sales, and service
· Authentic influencer partnerships fuel brand growth
· The strongest connections happen via call, click, chat, and camera.
· Time saved with AI leads to more creative work
· Seeking: A single source of truth
· TLDR; Get on social, try AI, and align your systems.
· More human marketing, powered by robots
ChatGPT is a revolutionary addition to the world since its introduction in 2022. A big shift in the sector of information gathering and processing happened because of this chatbot. What is the story of ChatGPT? How is the bot responding to prompts and generating contents? Swipe through these slides prepared by Expeed Software, a web development company regarding the development and technical intricacies of ChatGPT!
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
The realm of product design is a constantly changing environment where technology and style intersect. Every year introduces fresh challenges and exciting trends that mold the future of this captivating art form. In this piece, we delve into the significant trends set to influence the look and functionality of product design in the year 2024.
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
Mental health has been in the news quite a bit lately. Dozens of U.S. states are currently suing Meta for contributing to the youth mental health crisis by inserting addictive features into their products, while the U.S. Surgeon General is touring the nation to bring awareness to the growing epidemic of loneliness and isolation. The country has endured periods of low national morale, such as in the 1970s when high inflation and the energy crisis worsened public sentiment following the Vietnam War. The current mood, however, feels different. Gallup recently reported that national mental health is at an all-time low, with few bright spots to lift spirits.
To better understand how Americans are feeling and their attitudes towards mental health in general, ThinkNow conducted a nationally representative quantitative survey of 1,500 respondents and found some interesting differences among ethnic, age and gender groups.
Technology
For example, 52% agree that technology and social media have a negative impact on mental health, but when broken out by race, 61% of Whites felt technology had a negative effect, and only 48% of Hispanics thought it did.
While technology has helped us keep in touch with friends and family in faraway places, it appears to have degraded our ability to connect in person. Staying connected online is a double-edged sword since the same news feed that brings us pictures of the grandkids and fluffy kittens also feeds us news about the wars in Israel and Ukraine, the dysfunction in Washington, the latest mass shooting and the climate crisis.
Hispanics may have a built-in defense against the isolation technology breeds, owing to their large, multigenerational households, strong social support systems, and tendency to use social media to stay connected with relatives abroad.
Age and Gender
When asked how individuals rate their mental health, men rate it higher than women by 11 percentage points, and Baby Boomers rank it highest at 83%, saying it’s good or excellent vs. 57% of Gen Z saying the same.
Gen Z spends the most amount of time on social media, so the notion that social media negatively affects mental health appears to be correlated. Unfortunately, Gen Z is also the generation that’s least comfortable discussing mental health concerns with healthcare professionals. Only 40% of them state they’re comfortable discussing their issues with a professional compared to 60% of Millennials and 65% of Boomers.
Race Affects Attitudes
As seen in previous research conducted by ThinkNow, Asian Americans lag other groups when it comes to awareness of mental health issues. Twenty-four percent of Asian Americans believe that having a mental health issue is a sign of weakness compared to the 16% average for all groups. Asians are also considerably less likely to be aware of mental health services in their communities (42% vs. 55%) and most likely to seek out information on social media (51% vs. 35%).
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
Creative operations teams expect increased AI use in 2024. Currently, over half of tasks are not AI-enabled, but this is expected to decrease in the coming year. ChatGPT is the most popular AI tool currently. Business leaders are more actively exploring AI benefits than individual contributors. Most respondents do not believe AI will impact workforce size in 2024. However, some inhibitions still exist around AI accuracy and lack of understanding. Creatives primarily want to use AI to save time on mundane tasks and boost productivity.
Organizational culture includes values, norms, systems, symbols, language, assumptions, beliefs, and habits that influence employee behaviors and how people interpret those behaviors. It is important because culture can help or hinder a company's success. Some key aspects of Netflix's culture that help it achieve results include hiring smartly so every position has stars, focusing on attitude over just aptitude, and having a strict policy against peacocks, whiners, and jerks.
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
PepsiCo provided a safe harbor statement noting that any forward-looking statements are based on currently available information and are subject to risks and uncertainties. It also provided information on non-GAAP measures and directing readers to its website for disclosure and reconciliation. The document then discussed PepsiCo's business overview, including that it is a global beverage and convenient food company with iconic brands, $91 billion in net revenue in 2023, and nearly $14 billion in core operating profit. It operates through a divisional structure with a focus on local consumers.
Content Methodology: A Best Practices Report (Webinar)contently
This document provides an overview of content methodology best practices. It defines content methodology as establishing objectives, KPIs, and a culture of continuous learning and iteration. An effective methodology focuses on connecting with audiences, creating optimal content, and optimizing processes. It also discusses why a methodology is needed due to the competitive landscape, proliferation of channels, and opportunities for improvement. Components of an effective methodology include defining objectives and KPIs, audience analysis, identifying opportunities, and evaluating resources. The document concludes with recommendations around creating a content plan, testing and optimizing content over 90 days.
How to Prepare For a Successful Job Search for 2024Albert Qian
The document provides guidance on preparing a job search for 2024. It discusses the state of the job market, focusing on growth in AI and healthcare but also continued layoffs. It recommends figuring out what you want to do by researching interests and skills, then conducting informational interviews. The job search should involve building a personal brand on LinkedIn, actively applying to jobs, tailoring resumes and interviews, maintaining job hunting as a habit, and continuing self-improvement. Once hired, the document advises setting new goals and keeping skills and networking active in case of future opportunities.
A report by thenetworkone and Kurio.
The contributing experts and agencies are (in an alphabetical order): Sylwia Rytel, Social Media Supervisor, 180heartbeats + JUNG v MATT (PL), Sharlene Jenner, Vice President - Director of Engagement Strategy, Abelson Taylor (USA), Alex Casanovas, Digital Director, Atrevia (ES), Dora Beilin, Senior Social Strategist, Barrett Hoffher (USA), Min Seo, Campaign Director, Brand New Agency (KR), Deshé M. Gully, Associate Strategist, Day One Agency (USA), Francesca Trevisan, Strategist, Different (IT), Trevor Crossman, CX and Digital Transformation Director; Olivia Hussey, Strategic Planner; Simi Srinarula, Social Media Manager, The Hallway (AUS), James Hebbert, Managing Director, Hylink (CN / UK), Mundy Álvarez, Planning Director; Pedro Rojas, Social Media Manager; Pancho González, CCO, Inbrax (CH), Oana Oprea, Head of Digital Planning, Jam Session Agency (RO), Amy Bottrill, Social Account Director, Launch (UK), Gaby Arriaga, Founder, Leonardo1452 (MX), Shantesh S Row, Creative Director, Liwa (UAE), Rajesh Mehta, Chief Strategy Officer; Dhruv Gaur, Digital Planning Lead; Leonie Mergulhao, Account Supervisor - Social Media & PR, Medulla (IN), Aurelija Plioplytė, Head of Digital & Social, Not Perfect (LI), Daiana Khaidargaliyeva, Account Manager, Osaka Labs (UK / USA), Stefanie Söhnchen, Vice President Digital, PIABO Communications (DE), Elisabeth Winiartati, Managing Consultant, Head of Global Integrated Communications; Lydia Aprina, Account Manager, Integrated Marketing and Communications; Nita Prabowo, Account Manager, Integrated Marketing and Communications; Okhi, Web Developer, PNTR Group (ID), Kei Obusan, Insights Director; Daffi Ranandi, Insights Manager, Radarr (SG), Gautam Reghunath, Co-founder & CEO, Talented (IN), Donagh Humphreys, Head of Social and Digital Innovation, THINKHOUSE (IRE), Sarah Yim, Strategy Director, Zulu Alpha Kilo (CA).
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
The search marketing landscape is evolving rapidly with new technologies, and professionals, like you, rely on innovative paid search strategies to meet changing demands.
It’s important that you’re ready to implement new strategies in 2024.
Check this out and learn the top trends in paid search advertising that are expected to gain traction, so you can drive higher ROI more efficiently in 2024.
You’ll learn:
- The latest trends in AI and automation, and what this means for an evolving paid search ecosystem.
- New developments in privacy and data regulation.
- Emerging ad formats that are expected to make an impact next year.
Watch Sreekant Lanka from iQuanti and Irina Klein from OneMain Financial as they dive into the future of paid search and explore the trends, strategies, and technologies that will shape the search marketing landscape.
If you’re looking to assess your paid search strategy and design an industry-aligned plan for 2024, then this webinar is for you.
5 Public speaking tips from TED - Visualized summarySpeakerHub
From their humble beginnings in 1984, TED has grown into the world’s most powerful amplifier for speakers and thought-leaders to share their ideas. They have over 2,400 filmed talks (not including the 30,000+ TEDx videos) freely available online, and have hosted over 17,500 events around the world.
With over one billion views in a year, it’s no wonder that so many speakers are looking to TED for ideas on how to share their message more effectively.
The article “5 Public-Speaking Tips TED Gives Its Speakers”, by Carmine Gallo for Forbes, gives speakers five practical ways to connect with their audience, and effectively share their ideas on stage.
Whether you are gearing up to get on a TED stage yourself, or just want to master the skills that so many of their speakers possess, these tips and quotes from Chris Anderson, the TED Talks Curator, will encourage you to make the most impactful impression on your audience.
See the full article and more summaries like this on SpeakerHub here: https://speakerhub.com/blog/5-presentation-tips-ted-gives-its-speakers
See the original article on Forbes here:
http://www.forbes.com/forbes/welcome/?toURL=http://www.forbes.com/sites/carminegallo/2016/05/06/5-public-speaking-tips-ted-gives-its-speakers/&refURL=&referrer=#5c07a8221d9b
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
Everyone is in agreement that ChatGPT (and other generative AI tools) will shape the future of work. Yet there is little consensus on exactly how, when, and to what extent this technology will change our world.
Businesses that extract maximum value from ChatGPT will use it as a collaborative tool for everything from brainstorming to technical maintenance.
For individuals, now is the time to pinpoint the skills the future professional will need to thrive in the AI age.
Check out this presentation to understand what ChatGPT is, how it will shape the future of work, and how you can prepare to take advantage.
The document provides career advice for getting into the tech field, including:
- Doing projects and internships in college to build a portfolio.
- Learning about different roles and technologies through industry research.
- Contributing to open source projects to build experience and network.
- Developing a personal brand through a website and social media presence.
- Networking through events, communities, and finding a mentor.
- Practicing interviews through mock interviews and whiteboarding coding questions.
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
1. Core updates from Google periodically change how its algorithms assess and rank websites and pages. This can impact rankings through shifts in user intent, site quality issues being caught up to, world events influencing queries, and overhauls to search like the E-A-T framework.
2. There are many possible user intents beyond just transactional, navigational and informational. Identifying intent shifts is important during core updates. Sites may need to optimize for new intents through different content types and sections.
3. Responding effectively to core updates requires analyzing "before and after" data to understand changes, identifying new intents or page types, and ensuring content matches appropriate intents across video, images, knowledge graphs and more.
A brief introduction to DataScience with explaining of the concepts, algorithms, machine learning, supervised and unsupervised learning, clustering, statistics, data preprocessing, real-world applications etc.
It's part of a Data Science Corner Campaign where I will be discussing the fundamentals of DataScience, AIML, Statistics etc.
Time Management & Productivity - Best PracticesVit Horky
Here's my presentation on by proven best practices how to manage your work time effectively and how to improve your productivity. It includes practical tips and how to use tools such as Slack, Google Apps, Hubspot, Google Calendar, Gmail and others.
The six step guide to practical project managementMindGenius
The six step guide to practical project management
If you think managing projects is too difficult, think again.
We’ve stripped back project management processes to the
basics – to make it quicker and easier, without sacrificing
the vital ingredients for success.
“If you’re looking for some real-world guidance, then The Six Step Guide to Practical Project Management will help.”
Dr Andrew Makar, Tactical Project Management
12. Die null-Referenz:
Mein
Milliarden-
Dollar-Fehler.
TONYHOARE
Informatik-Pionier
Rama - Sir Charles Antony Richard Hoare giving a talk at the EPFL on 20th of June 2011
commons.wikimedia.org/wiki/File:Sir_Tony_Hoare_IMG_5125.jpg - CC BY-SA 2.0 FR - creativecommons.org/licenses/by-sa/2.0/fr/
Quelle: https://www.infoq.com/presentations/
Null-References-The-Billion-Dollar-Mistake-Tony-Hoare
105. 1) Identität von rechts
m >>= return = m
2) Identität von links
return x >>= f = f x
3) Assoziativität
(m >>= f) >>= g = m >>= (x . f x >>= g)
Quelle: http://www.inf.fu-berlin.de/lehre/SS09/PI02/docs/monaden.pdf
Ich möchte heute über eine etwas andere Art der Fehlerbehandlung sprechen: Programmierung ohne Exceptions.
Doch warum sollte man auf Exceptions verzichten?
Der Gründer von StackOverflow hat schon 2003 diese Aussage in einem Blogartikel getätigt.
Joel Spolsky nennt zwei Punkte, die Exceptions zu „GOTOs“ werden lassen.
Der erste Kritikpunkt ist, dass Exceptions im Code nicht sichtbar sind. Man kann nicht erkennen, ob eine Methode eine Exception wirft oder nicht.
Hier ist weder ersichtlich, welche Methode eine Exception werfen kann, noch wohin der Code im Fehlerfall springt.
Wie gut, dass es in Java Checked Exceptions gibt, nicht wahr?
In diesem klassischen Beispiel für eine Exception ist sofort ersichtlich, welche Methoden einen Fehler provozieren könnten.
Allerdings ist nur durch Nachverfolgung der kompletten Aufrufhierarchie der Codepunkt zu finden, zu dem im Fehlerfall gesprungen wird.
Und das ist Spolskys zweiter Kritikpunkt: Es gibt zu viele Ausstiegspunkte aus der Methode. Und da Exceptions den normalen Kontrollfluss unterbrechen, werden Daten ggfs. in einem ungültigen Zustand hinterlassen oder Pfade durch den Code genommen, die nicht vorhersehbar sind.
Wenn z.B. in der Aufrufhierarchie irgendwo ein weiteres Exception-Handling eingebaut wird, landet der Sprung auf einmal an einer ganz anderen Stelle. Das ist für den Entwickler schwer nachzuvollziehen.
Man könnte auch einfach ein GOTO nutzen und wüsste wenigstens verlässlich, wohin gesprungen wird.
Ok, Exceptions sind doof. Aber was können wir nun dagegen tun?
Ein ähnlich schwerwiegendes Problem ist das Konzept von „null“. Java 8 bietet schon eine Lösung für das null-Problem.
So sähe „normaler“ Code aus, der null prüft.
Schön ist natürlich auch die Kombination mit Exceptions ;-)
Aber zurück zum Thema. Wie können wir diesen null-Check nun loswerden?
Moderner Code verwendet kein null, sondern kennzeichnet durch Optional<T> explizit, dass evtl. kein Wert vorhanden ist.
Allerdings hat man durch den hier gezeigten Aufbau nichts gewonnen…
...daher sollte man Optional<T> gleich so verwenden, wie es gedacht ist.
Doch wie übertragen wir diese Idee nun auf das Exception-Handling?
Indem wir eine Datenstruktur einführen, die einen möglichen Fehlerzustand explizit macht: das Result-Objekt.
7:00
Doch bevor wir nun tiefer in die Materie einsteigen, stelle ich mich kurz vor. Mein Name ist Stefan Macke.
Ich habe ein kleines Blog, auf dem ich ab und an etwas über Java schreibe.
Wer mich kontaktieren möchte, kann das bei Twitter tun.
Ich betreibe seit gut zwei Jahren auch einen Podcast rund um die Ausbildung zum Fachinformatiker Anwendungsentwicklung.
Hört doch gerne mal rein. Oder empfehlt mich euren Azubis!
Ich arbeite bei der ALTE OLDENBURGER Krankenversicherung AG, einer privaten Krankenversicherung.
Nebenberuflich bin ich noch Dozent, u.a. für Programmierung und Software-Engineering, an der PHWT.
Beide sitzen in Vechta im Oldenburger Münsterland.
Wer das Oldenburger Münsterland nicht kennt: es ist die deutsche Region mit der größten Schweinedichte und heißt daher auch gerne „Schweinegürtel“…
…oder auch „Güllegürtel“.
9:00
Doch nun zurück zum eigentliche Thema. Ich habe heute drei Bereiche mitgebracht, über die ich sprechen möchte.
Das Titelthema: Railway Oriented Programming.
Was das Ganze mit Monaden zu tun hat.
Und zum Schluss noch ein Praxisbeispiel.
Beginnen wir mit einem Überblick über die Idee hinter dem Railway Oriented Programming.
Die Idee basiert auf der Fehlerbehandlung in der funktionalen Programmierung.
Dort verwendet man gerne „reine“ Funktionen, die keine Seiteneffekte auslösen, sondern ausschließlich auf den hineingegebenen Werten arbeiten und ein Ergebnis liefern.
Diese Methode wäre so eine „reine“ Funktion.
Aber sobald die Methode eine Exception erzeugt, ändert sich alles. Sie ist nun nicht mehr rein, sondern erzeugt ggfs. einen anderen Ausgang, als von außen sichtbar ist.
Kurzum: Die Methode „lügt“! Man erkennt von außen nicht mehr, dass es neben dem normalen Ausgang auch einen Fehlerfall geben kann.
Und dieser zweite Weg müsste auch anders behandelt werden als der normale, nämlich mit try/catch.
Um dies zu verhindern, kann man den potentiell fehlerhaften Ausgang der Methode explizit machen, indem man anstatt eine Exception zu werfen…
…ein Ergebnis liefert, dass diesen Zustand kapselt: ein „Result“.
Das Result-Objekt kann nun nach seinem Zustand gefragt werden, sodass darauf im aufrufenden Code reagiert werden kann.
Aber dadurch hätte man nichts gewonnen. Genau wie bei Optional.isPresent().
Und hier kommt das Railway Oriented Programming ins Spiel. Eine Fluent-API ermöglicht die weitere Programmierung ohne zu wissen, ob das Result fehlerhaft ist oder nicht. Die durchzuführenden Aktionen werden einfach verkettet und das Result-Objekt übernimmt die Steuerung, welche von ihnen tatsächlich ausgeführt werden.
Das Result-Objekt hat zwei interne Zustände (fehlerhaft und erfolgreich), die unterschiedlich auf empfangene Nachrichten reagieren.
Die mit onSuccess() übergebene Funktion wird nur im Zustand Success ausgeführt.
Analog verhält sich onFailure() im Zustand Failure.
Manchmal muss man Operationen auch unabhängig vom Zustand ausführen. Dafür ist onBoth() gedacht.
So einfach sieht das dann im Code des Result-Objekts aus.
Das allein reicht aber nicht, um die Aufrufe schön lesbar verketten zu können. Es muss eine Fluent-API her.
Damit wir die Methoden aneinanderhängen können, muss jeder Methodenaufruf ein Result-Objekt zurückgeben.
Also ergänzen wir die void-Methoden um ein entsprechendes return.
15:00
Dadurch können wir nun die Methodenaufrufe aneinanderreihen, aber haben auch noch einen weiteren Vorteil geschaffen. Wir müssen nicht mehr wissen, welchen Zustand das Result-Objekt hat. Es entscheidet selbst, ob Operationen ausgeführt werden sollen oder nicht. Also haben wir eine Kapselung des Fehlerzustands erreicht.
Die onSuccess-Methode übernimmt das „Auspacken“ des Werts im Result-Objekt…
….und reicht es an einen Konsumenten weiter.
Danach gibt sie das aktuelle – erfolgreiche – Result-Objekt zurück an den Aufrufer.
Eine weitere hilfreiche Methode ist ensure(). -Methode prüft, ob der enthaltene Wert eine bestimmte Anforderung erfüllt, und gibt das Ergebnis zurück.
Sie prüft, ob der enthaltene Wert eine bestimmte Anforderung erfüllt…
…und gibt im Erfolgsfall das aktuelle Result-Objekt zurück…
…bzw. andernfalls ein leeres fehlerhaftes Result.
Und als letztes Beispiel wendet die map()-Methode...
…die übergebene Funktion auf den Wert an…
…die ihn ggfs. in einen anderen Typen umwandelt…
…und verpackt das Resultat in ein neues Result-Objekt…
…bzw. ein leeres fehlerhaftes Ergebnis.
Wichtig ist noch, dass alle gezeigten Methoden gar nichts machen…
wenn bereits ein fehlerhaftes Result-Objekt vorliegt.
Die Methoden können nun wie in diesem Beispiel verkettet werden.
Sobald eine der Methoden auf einen Fehler stößt, wird der Zustand des Results entsprechend verändert und kann von nun an nicht mehr verlassen werden.
Und da dieser Ablauf so aussieht wie zwei parallel verlaufende Bahnschienen, hat der „Erfinder“ das Vorgehen Railway Oriented Programming genannt.
Die Idee von ROP stammt von Scott Wlaschin, der die Website fsharpforfunandprofit.com betreibt.
Aber so richtig darauf aufmerksam geworden bin ich durch den Pluralsight-Kurs von Vladimir Khorikov, in dem er das Konzept auf C# überträgt.
Ja, ich weiß: ich habe ein Sakrileg begangen und bei C# rumgeschaut.
Daran angelehnt habe ich mein eigenes Framework für ROP mit Java entwickelt, das ich bereits in „echten“ Projekten verwende.
20:00
Kommen wir nun zu einigen Vorteilen, die die Arbeit mit dem Result-Objekt im Vergleich zu Exceptions bietet.
Altbekannter Code enthält oftmals einen Großteil an Exception Handling.
Das macht ihn komplex und schwer zu verstehen.
Die Verwendung der FluentAPI macht den Code kürzer und lesbarer und er enthält nun weniger rein technische Fehlerbehandlungsroutinen.
Kürzer geht es eigentlich nur noch komplett ohne Fehlerbehandlung ;-)
Es werden keine teuren Exceptions, sondern potentiell leichtgewichtige Fehlerklassen verwendet, die auch einfach zu serialisieren sind. Dafür gibt es nachher noch ein Beispiel.
Außerdem sind z.B. in Streams keine Methoden erlaubt, die Exceptions werfen.
Dem kann man mit Result-Objekten gut begegnen.
ROP hat allerdings – wie so ziemlich jede Idee in der Programmierung – auch ein paar Nachteile.
Ein frühzeitiger Ausstieg aus der Aufrufkette ist nicht möglich und muss mit if/else geregelt werden.
Die Verwendung des Results ist „ansteckend“. Genau wie Checked Exceptions, die sich von Methode zu Methode fortpflanzen.
Der Verzicht auf Exceptions entspricht nicht dem üblichen Vorgehen zur Fehlerbehandlung, das die meisten Entwickler kennen.
Aber dieses Umdenken hat an anderer Stelle schon stattgefunden bzw. nimmt rasant Fahrt auf. Viele Konzepte aus der funktionalen Programmierung verwenden Java-Entwickler seit Java 8 inzwischen täglich. Beispiele sind Optional und die allseits beliebten Streams.
25:00
Diese beiden Beispiele passen sehr gut zum Ansatz von ROP, da sie alle eins gemeinsam haben: es handelt sich um Monaden.
Monaden kapseln ein abstraktes Konzept und erleichtern dem Entwickler den Umgang mit diesem.
Optional: Repräsentiert das Nicht-/Vorhandensein eines Wertes und vermeidet ausufernde null-Checks.
Stream: Repräsentiert potentiell mehrere Werte und vermeidet Iterationen.
Promise: Repräsentiert das Ergebnis einer asynchronen Operation und vermeidet Thread-Programmierung.
Result: Repräsentiert das potentiell fehlerhafte Ergebnis einer Operation und vermeidet Exception-Handling.
Monaden sind abstrakte Datenstrukturen, die 3 grundlegende Funktionen anbieten müssen.
1) Ein Typkonstruktor, der die Monade mit einem Datentypen parametrisiert.
Beispiele sind Optional<T> bzw. Result<TSuccess, TFailure>.
2) Eine Funktion, die aus einem normalen Datentypen eine Monade dieses Datentyps macht, ihn also quasi in der Monade einpackt. Diese Funktion heißt in funktionalen Programmiersprachen z.B. „return“ oder „unit“.
Beispiele:
Optional.of(5) macht aus dem Integer 5 ein Optional<Integer>
Result.success(„Wert“) macht aus dem String „Wert“ ein Result<String>
Optional.of() „verpackt“ den Basisdatentypen also in der Monade.
3) Eine Funktion, die eine andere Funktion als Parameter bekommt, die aus dem inneren Datentyp der Monade eine neue Monade eines beliebigen Datentyps erzeugt, und diese neue Monade zurückgibt. Der in der ursprünglichen Monade enthaltene Datentyp wir ausgepackt, die übergebene Funktion wird auf seinen Wert angewendet und das Ergebnis dieser Operation - das wiederum eine Monade ist, aber ggfs. mit einem anderen Datentypen - wird zurückgegeben. In funktionalen Sprachen heißt diese Funktion z.B. „bind()“ oder „flatMap()“.
Schauen wir uns ein Beispiel für flatMap() auf Stream an.
Die erste Methode der Kette erzeugt einen Stream…
…der allerdings Arrays als Elemente enthält, also eigentlich nicht nur jeweils einen Wert, sondern gleich mehrere.
Auf die Elemente dieses Streams wird nun Stream.of() angewendet…
…eine Methode, die aus einer Liste von Werten einen Stream dieser Werte erzeugt.
Somit werden die einzelnen Arrays jeweils in einen neuen Stream umgewandelt.
Und als Ergebnis erhalten wir einen Stream<Stream<Integer>>. Aber eigentlich hätten wir gerne einen „flachen“ Stream<Integer>.
Und das übernimmt nun flatMap(). Die Methode „extrahiert“ die Teilstreams und hängt sie zu einem langen Stream einzelner Werte hintereinander.
Die drei Funktionen müssen noch drei Gesetze einhalten.
31:00
Dies sind die drei Gesetze in Haskell-Schreibweise. Wir wollen sie an dieser Stelle aufgrund fehlender Zeit nicht vertiefen.
Letztlich geht es darum, wie Monaden und ihre Funktionen miteinander verkettet werden können.
Eigentlich zählt Optional in Java damit nicht zu den Monaden, da eines der Gesetze verletzt wird. Aber das ist für den Praxiseinsatz nicht allzu relevant.
„Bereits linke Identität ist nicht gewährleistet, weil es kein "unit" wie für Maybe gibt, das einfach nur den Wert wrappt. Optional hat zwar Optional.of, aber das schmeißt eine Exception, wenn man "null" übergibt und scheidet somit aus. Dann gibt es noch Optional.ofNullable, aber wenn man das mit null füttert, so bekommt man kein Optional(null), sondern ein Optional.Empty. Man hat also keine Möglichkeit, jeden beliegen Wert zu wrappen, daraus folgt, dass Optional.of(A).flatMap(f) == f(A) nicht immer erfüllt ist.“
Quelle: https://www.heise.de/forum/heise-Developer/Kommentare/Railway-Oriented-Programming-in-Java/Re-Java-versagt-Optional-ist-keine-Monade/posting-29819640/show/
Schauen wir uns nun ein paar Beispiele für den Praxiseinsatz der Result-Monade an.
ROP lässt sich gut mit den Konzepten von DDD verbinden.
Factory-Methoden für Value Objects bieten sich z.B. für den Rückgabetyp Result an, da sie meistens eine Form der Validierung enthalten, die erwartungsgemäß auch fehlschlagen kann.
Das Result-Objekt könnte als Ersatz für die (teuren) Exceptions eingeführt werden, wenn der Fehlerfall ganz „normal“ ist, wie z.B. bei Validierungen. Eine „echte“ Ausnahme (z.B. Speicher voll), kann (und sollte) weiterhin eine Exception sein, die das Programm beendet.
Hier ist ein Beispiel einer Fehler-Klasse aus einem echten Projekt, die als TFailure genutzt wird. Sie ermöglicht z.B. eine einfache Übersetzung aller möglichen Fehler an einer zentralen Stelle.
Außerdem ist sie auch einfach zu serialisieren und z.B. per REST zu übertragen.
Das mag aussehen wie ein Rückschritt zu prozeduralem Code mit Return Codes, aber in der Praxis ist das Vorgehen sehr gut einsetzbar und hat mir viel Zeit gespart.
Außerdem wollen wir ja funktional entwickeln und LISP stammt auch aus den 1950er Jahren ;-)
Testen kann man gegen das Result-Objekt auch sehr schön. Mit ein paar eigenen Hamcrest-Matchern lesen sich die JUnit-Tests sehr schön.
So sieht der Testcode aus, der gegen Result-Objekte läuft.
37:00
Monaden sind nicht nur etwas für Theoretiker. Die gezeigten Beispiele demonstrieren die Nützlichkeit für die tägliche Arbeit in der Praxis.
Auch wenn einige Monaden in Java ggfs. nicht 100% konform zu den Regeln sind, kann man sie in der Praxis gut einsetzen.
F# 4.1 integriert Result<T> als fester Bestandteil der Sprache.
Scala bietet zwei Monaden an, die dem Konzept von Result ähneln: Try und Either.
Wer Lust auf noch mehr coole (monadische) Datentypen in Java hat, dem sei die Bibliothek JavaSlang empfohlen.