Попробовали на работе предметно-ориентированное проектирование (Domain Driven Design). Это такой способ построения архитектуры, когда ты (чаще всего с помощью системы типов и ООП) описываешь физическую суть вещей, которые представлены в твоей программе.
Например, если в программе есть объект "Книга", то её нужно снабдить свойствами, которые бывают у книг в реальности: число страниц, автор, язык, тип обложки и т.д. При этом данные свойства должны быть такими, чтобы присвоить им нереалистичные значения было нельзя. Допустим, число страниц не может быть отрицательным (и скорее всего в реальном мире не может быть нулём). При попытке установить отрицательное число страниц программа должна выбросить исключение. А совсем в идеальном случае -- не дать этого сделать программисту на уровне статического анализа кода.
Описав все свойства книги, вы снабжаете её операциями, которые над ней можно сделать. Например, из книги можно вырвать страницу, и при этом число страниц уменьшается. Нет такого случая, когда можно вырвать страницу без изменения числа страниц. Вы строго программируете эту зависимость, делаете у книги метод "Вырвать страницу", а он уже уменьшает число. Кстати, свойство "Число страниц" при этом нельзя переназначить в уже созданной книге. Можно только создать книгу, передав в её конструктор (так называется в программировании функция создания объектов) заданное число страниц. Но поменять число страниц можно только специальными методами "Вырвать страницу" и "Вклеить страницу".
С помощью этого подхода вы гарантируете, что ваши объекты всегда находятся в валидном состоянии -- то есть таком, которое возможно в реальной жизни с объектом, представленным программой.
Плюсы подхода очевидны: меньше число ошибок. Код описывает сам себя, и программист, если не лезет внутрь объекта "Книга", вообще не сможет сделать с книгой ничего недопустимого.
Минусы, думаю, тоже понятны: изначально проектировать сложнее, нужно учесть много нюансов, писать тесты. Время разработки изрядно растёт. Изменение требований даётся дороже: например, если каким-то образом в ваш книжный магазин поступят книги со страницами из кевлара, которые невозможно вырвать :)
Но первый проект с этим подходом мы сдали хорошо, без багов. Лучше, чем многие предыдущие.
#dev
#LYFT
LYFT начал пробивать сопротивление - цена выросла почти +80% за месяц - поздравляю всех, кто участвовал в этом ралли.
Что дальше? Ну скорее всего где-то откатит, так как пробитый уровень нужно тестировать = но долгосрочная картина пока бычья.
🛴Americans drift from Uber and Lyft, test alternative forms of transportation
Americans are exploring alternative methods of transportation. Looking at average daily active users (DAUs) per month over the past 13 months, we’re estimating decreases in active usage for #Uber and #Lyft, while seeing increases in active usage for things like public transportation, bikes and scooters.
The above data is for the United States and is a combination of iOS + Google Play apps. Lyft has said its market share in the United States was at about 35% in early 2018, and is now closing in at around 40%. Lyft is losing less average DAUs than Uber, which has in fact grown its percentage of market share in the United States.
Read more on Apptopia.
🚀@PerspectiveIX
🚖 Lyft Closing New User Gap with Uber in U.S. as IPO Approaches
As it prepares for its long-awaited IPO, #Lyft has been slowly yet surely pulling alongside rival #Uber in the United States when it comes to the number of new users both services are adding each month.
According to Sensor Tower, which count first-time downloads of apps by unique App Store and Google Play users, Lyft added close to 1.5 million new riders in the U.S. last month, compared to Uber’s 1.9 million, giving the soon-to-be-public company a 43 percent share of those acquired between the two. This is a significant turnaround from April 2015, when Uber accounted for 82 percent of new U.S. riders added by the two services that month.
Read more on SensorTower.
🚀@PerspectiveIX
🚕Uber vs. Lyft: Loyalty Edition
Ride-sharing customers are becoming less loyal.
Americans who used both #Uber and #Lyft in the last quarter of 2018 accounted for about a third of the companies’ ride-sharing revenue, according to new data from Earnest Research. That’s up 13 percentage points from the beginning of 2016.
🚀@PerspectiveIX via Recode.
🚕Lyft has eaten into Uber’s U.S. market share
#Uber controls the majority of U.S. ride-hailing but #Lyft is growing twice as fast. And both plan to go public in early 2019.
🚀@PerspectiveIX via Recode.
🚗Lyft продаст свое подразделение по производству беспилотных автомобилей подразделению Toyota за $550 млн.
В рамках сделки компании будут работать вместе над повышением безопасности технологий автоматизированного вождения.
📈 Президент Lyft сказал, соглашение позволит им сосредоточиться на продвижении своей автономной платформы и транспортной сети, а также сократить убытки.
На фоне заявления о продаже подразделения, акции Lyft выросли более чем на 2%.
#США#Lyft#Toyota
💰Gig Economy Workers Are Earning Half What They Did Five Years Ago
More people are working for ride-sharing and delivery companies but on average they’re making less.
On average, drivers who transport people (#Uber or #Lyft) or things (#UberEats or #Postmates) through an app made 53 percent less in 2017 than they did in 2013, according to a new study by the JPMorgan Chase Institute.
The average monthly payments to those who worked for a transportation app in a given month declined to $783 from $1,469. Meanwhile, people working for leasing apps — #Airbnb, Turo, Parklee and other apps that let you rent assets like your home, car or parking space — saw their incomes from those platforms rise 69 percent to $1,736 on average.
This is happening as online gig work has become more popular, thanks in large part to the growth in the number transportation jobs.
🚀@PerspectiveIX via Recode.
💰Libra: Facebook confirms its cryptocurrency launching in 2020
#Libra is designed not to be a speculative asset, like #Bitcoin, but a form of digital money backed by a reserve of assets.
The company has formed the nonprofit Libra Association with 27 other partners to oversee Libra and its development. The partnership includes venture capital firms, nonprofit organizations, #cryptocurrency firms, and massive corporate financial, telecommunications, and technology service providers, including #Coinbase, #Mastercard, #Visa, #eBay, #PayPal, #Stripe, #Spotify, #Uber, #Lyft, and #Vodafone.
While the Libra Association will have members based globally, it will be headquartered in Geneva, Switzerland🇨🇭
Facebook has a business incentive to build on top of the Libra #blockchain, and it’s launching its own subsidiary to do just that called #Calibra (see the GIF below - Credit: Facebook). According to Kevin Weil, Facebook's VP of Product, Calibra will live inside of Facebook Messenger and WhatsApp at launch, but will also have a standalone iOS and Android app.
🔗 Read more the Verge.
🚀@PerspectiveIX