Guice is a lightweight Java dependency injection framework that allows developers to declare dependencies through modules and inject them using annotations. With Guice, developers can define bindings between interfaces and implementations, and annotate constructors and fields to have dependencies automatically injected without needing to manually wire objects together. This reduces boilerplate code and makes applications easier to test by simplifying mocking of dependencies.
Guice is a lightweight Java dependency injection framework that allows developers to declare dependencies through modules and inject them using annotations. With Guice, developers can define bindings between interfaces and implementations, and annotate constructors and fields to specify injection points. This reduces boilerplate code compared to alternatives like implementing dependency injection by hand. Guice validates dependencies at startup and handles circular dependencies automatically.
Guice is a lightweight Java dependency injection framework that allows developers to declare dependencies through annotations rather than through manual wiring code. With Guice, classes declare their dependencies through constructor injection using the @Inject annotation. Modules are implemented to map interfaces to implementations, specifying scopes. At runtime, Guice handles satisfying all declared dependencies through its generated injector without additional factory code. This reduces boilerplate and makes dependencies explicit and easy to manage.
This document provides an introduction to microservices and reactive programming using Spring Cloud and RxJava. It covers microservice development with Spring Cloud, including service registration and discovery with Eureka, circuit breaking with Hystrix, configuration with Spring Cloud Configuration Server, and API gateway patterns. It also provides an overview of reactive programming concepts in RxJava like Observables and Subscribers and examples of using RxJava to build reactive microservices that compose asynchronous operations.
This document introduces Google Guice, a dependency injection framework. It discusses dependency injection, benefits like separation of concerns and easier testing. It also covers disadvantages like potential maintenance issues. The document explores the Guice API including Injector, Module, Binder and different types of bindings like linked, annotated, instance and constructor bindings. It provides a simple example using traits, classes and annotations to demonstrate dependency injection with Guice. References for more information on Guice and dependency injection are also included.
This document discusses effective practices for dependency injection (DI). It begins with a quick DI refresher and then provides guidelines for DI such as: explicitly defining dependencies, injecting exactly what is needed, preferring constructor injection, avoiding work in constructors, and avoiding direct dependencies on the injector. It also discusses testing code using DI, applying DI to existing code, and techniques for migrating code to use DI such as bottom-up or top-down approaches.
SOLID Design Principles applied in JavaIonut Bilica
Video: https://www.youtube.com/watch?v=0cU-4LrcWI0
SOLID Design Principles applied in Java: rules to develop scalable and easily maintainable code
Speaker: Ionut Bilica - Senior Software Developer @ Luxoft Romania.
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will asses how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
Guice is a lightweight dependency injection framework for Java that allows configuring object bindings through modules. With Guice, classes declare their dependencies through constructor or field injection using the @Inject annotation rather than looking them up directly through factories. This improves testability. Modules map interfaces to implementations using a fluent binding API. At runtime, Guice uses this configuration to satisfy injection points. This reduces boilerplate code compared to manually wiring dependencies.
Guice is a lightweight Java dependency injection framework that allows developers to declare dependencies through modules and inject them using annotations. With Guice, developers can define bindings between interfaces and implementations, and annotate constructors and fields to have dependencies automatically injected without needing to manually wire objects together. This reduces boilerplate code and makes applications easier to test by simplifying mocking of dependencies.
Guice is a lightweight Java dependency injection framework that allows developers to declare dependencies through modules and inject them using annotations. With Guice, developers can define bindings between interfaces and implementations, and annotate constructors and fields to specify injection points. This reduces boilerplate code compared to alternatives like implementing dependency injection by hand. Guice validates dependencies at startup and handles circular dependencies automatically.
Guice is a lightweight Java dependency injection framework that allows developers to declare dependencies through annotations rather than through manual wiring code. With Guice, classes declare their dependencies through constructor injection using the @Inject annotation. Modules are implemented to map interfaces to implementations, specifying scopes. At runtime, Guice handles satisfying all declared dependencies through its generated injector without additional factory code. This reduces boilerplate and makes dependencies explicit and easy to manage.
This document provides an introduction to microservices and reactive programming using Spring Cloud and RxJava. It covers microservice development with Spring Cloud, including service registration and discovery with Eureka, circuit breaking with Hystrix, configuration with Spring Cloud Configuration Server, and API gateway patterns. It also provides an overview of reactive programming concepts in RxJava like Observables and Subscribers and examples of using RxJava to build reactive microservices that compose asynchronous operations.
This document introduces Google Guice, a dependency injection framework. It discusses dependency injection, benefits like separation of concerns and easier testing. It also covers disadvantages like potential maintenance issues. The document explores the Guice API including Injector, Module, Binder and different types of bindings like linked, annotated, instance and constructor bindings. It provides a simple example using traits, classes and annotations to demonstrate dependency injection with Guice. References for more information on Guice and dependency injection are also included.
This document discusses effective practices for dependency injection (DI). It begins with a quick DI refresher and then provides guidelines for DI such as: explicitly defining dependencies, injecting exactly what is needed, preferring constructor injection, avoiding work in constructors, and avoiding direct dependencies on the injector. It also discusses testing code using DI, applying DI to existing code, and techniques for migrating code to use DI such as bottom-up or top-down approaches.
SOLID Design Principles applied in JavaIonut Bilica
Video: https://www.youtube.com/watch?v=0cU-4LrcWI0
SOLID Design Principles applied in Java: rules to develop scalable and easily maintainable code
Speaker: Ionut Bilica - Senior Software Developer @ Luxoft Romania.
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will asses how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
Guice is a lightweight dependency injection framework for Java that allows configuring object bindings through modules. With Guice, classes declare their dependencies through constructor or field injection using the @Inject annotation rather than looking them up directly through factories. This improves testability. Modules map interfaces to implementations using a fluent binding API. At runtime, Guice uses this configuration to satisfy injection points. This reduces boilerplate code compared to manually wiring dependencies.
Guice is a lightweight dependency injection framework for Java that allows configuring object bindings through modules. With Guice, classes declare their dependencies through constructor or field injection using the @Inject annotation rather than looking them up directly through factories. This improves testability. Modules map interfaces to implementations using a fluent binding API. At runtime, Guice uses this configuration to satisfy injection points. This reduces boilerplate code compared to manually wiring dependencies.
Through this presentation you will gain a good understanding of how the clean architecture pattern is implemented at Taxibeat. What issues the Android Taxibeat team has faced so far and what solutions we came up with. Of course, the benefits of clean architecture will also be discussed along with the way we managed to build two fast paced iterative apps that share functionality.
MongoDB.local Atlanta: Introduction to Serverless MongoDBMongoDB
Serverless development with MongoDB Stitch allows developers to build applications without managing infrastructure. Stitch provides four main services - QueryAnywhere for data access, Functions for server-side logic, Triggers for real-time notifications, and Mobile Sync for offline data synchronization. These services integrate with MongoDB and other data sources through a unified API, and apply access controls and filters to queries. Functions can be used to build applications or enable data services, and are integrated with application context including user information, services, and values. This allows developers to write code without dealing with deployment or scaling.
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will assess how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
This document introduces Interaction-Driven Design (IDD) and discusses best practices for application structure and testing strategies when using this approach. It recommends starting the design process from the user interactions or actions needed, which will help define domain concepts and emerging entities. The core domain model should be separated from infrastructure implementations. Testing strategies covered include user journey tests at the application level, acceptance tests at the action level, integration tests at boundaries, and unit tests at the class level. Dependencies should be mocked or stubbed at different test levels.
(IMPROVED VERSION FROM GEECON)
How can we quickly tell what an application is about? How can we quickly tell what it does? How can we distinguish business concepts from architecture clutter? How can we quickly find the code we want to change? How can we instinctively know where to add code for new features? Purely looking at unit tests is either not possible or too painful. Looking at higher-level tests can take a long time and still not give us the answers we need. For years, we have all struggled to design and structure projects that reflect the business domain.
In this talk Sandro will be sharing how he designed the last application he worked on, twisting a few concepts from Domain-Driven Design, properly applying MVC, borrowing concepts from CQRS, and structuring packages in non-conventional ways. Sandro will also be touching on SOLID principles, Agile incremental design, modularisation, and testing. By iteratively modifying the project structure to better model the application requirements, he has come up with a design style that helps developers create maintainable and domain-oriented software.
Complexity Measures for Secure Service-Orieted Software ArchitecturesTim Menzies
The document proposes a measurement framework to quantitatively assess attackability in early software development. It defines metrics for service complexity and URL jumping attack effort/reward. An empirical study on an online flower shop system calculates these metrics and finds a strong correlation between service complexity and relative attackability. More case studies are needed to generalize the relationships between structural attributes and attack success likelihood.
High Performance Cloud Native APIs Using Apache Geode VMware Tanzu
SpringOne Platform 2017
Anna Jung, HCSC; Paul Vermeulen, Pivotal
"Traditionally cloud native APIs contain the logic to convert data from repositories into information. As the dataset grows it is difficult to scale traditional databases to meet increasing transaction volume. Apache Geode provides high speed, zero downtime data access that allows you to build fast, highly available APIs.
In this session, Anna and Paul will cover how to seamlessly integrate Apache Geode's high performance functions with cloud native APIs. In addition, they will showcase how to test drive the development of Apache Geode backed solutions (Test Driven Development)."
The document discusses the SOLID principles of object-oriented design, which are a set of five design guidelines for developing flexible and maintainable software. It describes each principle - Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion - and provides examples of how to apply each principle through class design. It also discusses related concepts like dependency injection, the service locator pattern, and inversion of control. The goal of SOLID is to build software that is understandable, flexible and maintainable over time.
How much do we know about Object-Oriented Programming?Sandro Mancuso
This talk goes through many of the Object-Oriented Programming principles and characteristics. Things that all developers should have in mind while writing code.
Crafted Design - LJC World Tour Mash Up 2014Sandro Mancuso
This document introduces Interaction-Driven Design (IDD) and discusses concepts related to application architecture and testing strategies. It describes how IDD uses an outside-in approach where the design starts from actions and behaviors rather than data structures. Classes closer to user inputs focus on flow control and delegation, while those closer to outputs focus on specific behaviors with less delegation. The document also covers domain-driven design concepts like entities, aggregates, and repositories, and discusses strategies for unit, integration, acceptance, and end-to-end testing.
The document discusses middleware and microservices architectures. Middleware makes it easier for developers to implement communication and input/output between applications and systems. It gained popularity in the 1980s as a way to connect newer apps to older legacy systems. Microservices architectures break applications into smaller, independent pieces that can be updated independently. While this improves scalability and maintainability, it also increases complexity and the security surface. The document provides examples of middleware and microservices architectures used by companies like Netflix and Twitter.
Presentation on getting started with the Swiz framework for Adobe Flex. It concentrates on solving problems around IoC, dependency injection, event handling and interacting with external services.
My way to clean android (EN) - Android day salamanca editionChristian Panadero
This document summarizes Christian Panadero's presentation on "My way to clean Android". It discusses clean architecture principles for Android applications, including separating components by abstraction level and dependency rules. It outlines the project structure with separate modules for presentation, domain, and data layers. It also provides examples of interactions between these layers using common design patterns like MVP, repositories, and dependency injection. The goal is to make implementations swappable and the codebase independent of frameworks and external factors for maximum testability and flexibility.
How to write automated tests and don’t lose your mind by Dorian Sarnowski ScalacScalac
Jak pisać testy i nie zwariować?
Pragmatyczne podejście do pisania testów z punktu widzenia programisty. Garść przemyśleń i dobrych wzorców wyniesiona z dotychczasowych projektów oraz opis najczęściej popełnianych błędów i pułapki, które na nas czyhają.
Selise Tech talk presentation 2014
SELISE rockin’ software is going to organize the first of its kind TechTalk in Dhaka. The event features activities for both professional software developers and fresh graduates.
The morning session holds a recruitment program only for fresh CSE graduates which includes a coding competition.
In the evening, software professionals from around the country are welcome to participate in three Keynotes, held by leading Tech experts on state of the art technologies.
This document discusses end-to-end security in mobile cloud computing. It defines mobile cloud computing and explains its advantages over mobile devices alone. The document outlines challenges to end-to-end security in service-oriented architectures and mobile cloud computing. It proposes a security framework that uses taint analysis and aspect-oriented programming to monitor service executions and detect unauthorized external service invocations. A trust broker would maintain trust sessions and evaluate the trustworthiness of services to ensure end-to-end security.
Presentation on design pattern software project lll Uchiha Shahin
We have prepared a presentation on design pattern. Here are 7 types of design pattern we have presented.
1. Mediator Design
2. Iterator Pattern
3. Bridge Pattern
4. Decorator Pattern
5. Composite Pattern
6. Template Pattern
7. Singleton Pattern
Here is the link of Canva Slide to use as template----
https://www.canva.com/design/DAEmun8Sjks/NmH08MOYrAWSaTERNbe5LA/view?utm_content=DAEmun8Sjks&utm_campaign=designshare&utm_medium=link&utm_source=sharebutton&mode=preview
You can contact me in LinkedIn or any other social platform for more infromation.
Thank you.
The Magic Of Application Lifecycle Management In Vs PublicDavid Solivan
The document discusses challenges with software development projects and how tools from Microsoft can help address these challenges. It notes that most projects fail or are over budget and challenges include poor requirements gathering and testing. However, tools like Visual Studio and Team Foundation Server that integrate requirements, work tracking, source control, testing and other functions can help make successful projects more possible by facilitating team collaboration. The document outlines features of these tools and how they aim to make application lifecycle management a routine part of development.
Guice is a lightweight dependency injection framework for Java that allows configuring object bindings through modules. With Guice, classes declare their dependencies through constructor or field injection using the @Inject annotation rather than looking them up directly through factories. This improves testability. Modules map interfaces to implementations using a fluent binding API. At runtime, Guice uses this configuration to satisfy injection points. This reduces boilerplate code compared to manually wiring dependencies.
Through this presentation you will gain a good understanding of how the clean architecture pattern is implemented at Taxibeat. What issues the Android Taxibeat team has faced so far and what solutions we came up with. Of course, the benefits of clean architecture will also be discussed along with the way we managed to build two fast paced iterative apps that share functionality.
MongoDB.local Atlanta: Introduction to Serverless MongoDBMongoDB
Serverless development with MongoDB Stitch allows developers to build applications without managing infrastructure. Stitch provides four main services - QueryAnywhere for data access, Functions for server-side logic, Triggers for real-time notifications, and Mobile Sync for offline data synchronization. These services integrate with MongoDB and other data sources through a unified API, and apply access controls and filters to queries. Functions can be used to build applications or enable data services, and are integrated with application context including user information, services, and values. This allows developers to write code without dealing with deployment or scaling.
During this talk we will discuss about the SOLID Principles described by Robert C. Martin, applying them in the Java programming language. Each principle will be explained in detail, with practical Java examples.
We will assess how these principles make it easy to develop the software for the entire duration of the project, and how some problems can appear if these principles are not applied. We will present common code fragments that do not respect these principles, and we'll see how we can correct them. Taking the SOLID principles into consideration, we will also analyse a real Java project using a Static Code Analyzer tool (e.g. STAN).
Finally, we will discuss the strategies on how to apply these design principles in "greenfield" projects, as well as "legacy" projects, while offering some tips and tricks.
This document introduces Interaction-Driven Design (IDD) and discusses best practices for application structure and testing strategies when using this approach. It recommends starting the design process from the user interactions or actions needed, which will help define domain concepts and emerging entities. The core domain model should be separated from infrastructure implementations. Testing strategies covered include user journey tests at the application level, acceptance tests at the action level, integration tests at boundaries, and unit tests at the class level. Dependencies should be mocked or stubbed at different test levels.
(IMPROVED VERSION FROM GEECON)
How can we quickly tell what an application is about? How can we quickly tell what it does? How can we distinguish business concepts from architecture clutter? How can we quickly find the code we want to change? How can we instinctively know where to add code for new features? Purely looking at unit tests is either not possible or too painful. Looking at higher-level tests can take a long time and still not give us the answers we need. For years, we have all struggled to design and structure projects that reflect the business domain.
In this talk Sandro will be sharing how he designed the last application he worked on, twisting a few concepts from Domain-Driven Design, properly applying MVC, borrowing concepts from CQRS, and structuring packages in non-conventional ways. Sandro will also be touching on SOLID principles, Agile incremental design, modularisation, and testing. By iteratively modifying the project structure to better model the application requirements, he has come up with a design style that helps developers create maintainable and domain-oriented software.
Complexity Measures for Secure Service-Orieted Software ArchitecturesTim Menzies
The document proposes a measurement framework to quantitatively assess attackability in early software development. It defines metrics for service complexity and URL jumping attack effort/reward. An empirical study on an online flower shop system calculates these metrics and finds a strong correlation between service complexity and relative attackability. More case studies are needed to generalize the relationships between structural attributes and attack success likelihood.
High Performance Cloud Native APIs Using Apache Geode VMware Tanzu
SpringOne Platform 2017
Anna Jung, HCSC; Paul Vermeulen, Pivotal
"Traditionally cloud native APIs contain the logic to convert data from repositories into information. As the dataset grows it is difficult to scale traditional databases to meet increasing transaction volume. Apache Geode provides high speed, zero downtime data access that allows you to build fast, highly available APIs.
In this session, Anna and Paul will cover how to seamlessly integrate Apache Geode's high performance functions with cloud native APIs. In addition, they will showcase how to test drive the development of Apache Geode backed solutions (Test Driven Development)."
The document discusses the SOLID principles of object-oriented design, which are a set of five design guidelines for developing flexible and maintainable software. It describes each principle - Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion - and provides examples of how to apply each principle through class design. It also discusses related concepts like dependency injection, the service locator pattern, and inversion of control. The goal of SOLID is to build software that is understandable, flexible and maintainable over time.
How much do we know about Object-Oriented Programming?Sandro Mancuso
This talk goes through many of the Object-Oriented Programming principles and characteristics. Things that all developers should have in mind while writing code.
Crafted Design - LJC World Tour Mash Up 2014Sandro Mancuso
This document introduces Interaction-Driven Design (IDD) and discusses concepts related to application architecture and testing strategies. It describes how IDD uses an outside-in approach where the design starts from actions and behaviors rather than data structures. Classes closer to user inputs focus on flow control and delegation, while those closer to outputs focus on specific behaviors with less delegation. The document also covers domain-driven design concepts like entities, aggregates, and repositories, and discusses strategies for unit, integration, acceptance, and end-to-end testing.
The document discusses middleware and microservices architectures. Middleware makes it easier for developers to implement communication and input/output between applications and systems. It gained popularity in the 1980s as a way to connect newer apps to older legacy systems. Microservices architectures break applications into smaller, independent pieces that can be updated independently. While this improves scalability and maintainability, it also increases complexity and the security surface. The document provides examples of middleware and microservices architectures used by companies like Netflix and Twitter.
Presentation on getting started with the Swiz framework for Adobe Flex. It concentrates on solving problems around IoC, dependency injection, event handling and interacting with external services.
My way to clean android (EN) - Android day salamanca editionChristian Panadero
This document summarizes Christian Panadero's presentation on "My way to clean Android". It discusses clean architecture principles for Android applications, including separating components by abstraction level and dependency rules. It outlines the project structure with separate modules for presentation, domain, and data layers. It also provides examples of interactions between these layers using common design patterns like MVP, repositories, and dependency injection. The goal is to make implementations swappable and the codebase independent of frameworks and external factors for maximum testability and flexibility.
How to write automated tests and don’t lose your mind by Dorian Sarnowski ScalacScalac
Jak pisać testy i nie zwariować?
Pragmatyczne podejście do pisania testów z punktu widzenia programisty. Garść przemyśleń i dobrych wzorców wyniesiona z dotychczasowych projektów oraz opis najczęściej popełnianych błędów i pułapki, które na nas czyhają.
Selise Tech talk presentation 2014
SELISE rockin’ software is going to organize the first of its kind TechTalk in Dhaka. The event features activities for both professional software developers and fresh graduates.
The morning session holds a recruitment program only for fresh CSE graduates which includes a coding competition.
In the evening, software professionals from around the country are welcome to participate in three Keynotes, held by leading Tech experts on state of the art technologies.
This document discusses end-to-end security in mobile cloud computing. It defines mobile cloud computing and explains its advantages over mobile devices alone. The document outlines challenges to end-to-end security in service-oriented architectures and mobile cloud computing. It proposes a security framework that uses taint analysis and aspect-oriented programming to monitor service executions and detect unauthorized external service invocations. A trust broker would maintain trust sessions and evaluate the trustworthiness of services to ensure end-to-end security.
Presentation on design pattern software project lll Uchiha Shahin
We have prepared a presentation on design pattern. Here are 7 types of design pattern we have presented.
1. Mediator Design
2. Iterator Pattern
3. Bridge Pattern
4. Decorator Pattern
5. Composite Pattern
6. Template Pattern
7. Singleton Pattern
Here is the link of Canva Slide to use as template----
https://www.canva.com/design/DAEmun8Sjks/NmH08MOYrAWSaTERNbe5LA/view?utm_content=DAEmun8Sjks&utm_campaign=designshare&utm_medium=link&utm_source=sharebutton&mode=preview
You can contact me in LinkedIn or any other social platform for more infromation.
Thank you.
The Magic Of Application Lifecycle Management In Vs PublicDavid Solivan
The document discusses challenges with software development projects and how tools from Microsoft can help address these challenges. It notes that most projects fail or are over budget and challenges include poor requirements gathering and testing. However, tools like Visual Studio and Team Foundation Server that integrate requirements, work tracking, source control, testing and other functions can help make successful projects more possible by facilitating team collaboration. The document outlines features of these tools and how they aim to make application lifecycle management a routine part of development.
Ready to Unlock the Power of Blockchain!Toptal Tech
Imagine a world where data flows freely, yet remains secure. A world where trust is built into the fabric of every transaction. This is the promise of blockchain, a revolutionary technology poised to reshape our digital landscape.
Toptal Tech is at the forefront of this innovation, connecting you with the brightest minds in blockchain development. Together, we can unlock the potential of this transformative technology, building a future of transparency, security, and endless possibilities.
HijackLoader Evolution: Interactive Process HollowingDonato Onofri
CrowdStrike researchers have identified a HijackLoader (aka IDAT Loader) sample that employs sophisticated evasion techniques to enhance the complexity of the threat. HijackLoader, an increasingly popular tool among adversaries for deploying additional payloads and tooling, continues to evolve as its developers experiment and enhance its capabilities.
In their analysis of a recent HijackLoader sample, CrowdStrike researchers discovered new techniques designed to increase the defense evasion capabilities of the loader. The malware developer used a standard process hollowing technique coupled with an additional trigger that was activated by the parent process writing to a pipe. This new approach, called "Interactive Process Hollowing", has the potential to make defense evasion stealthier.
Discover the benefits of outsourcing SEO to Indiadavidjhones387
"Discover the benefits of outsourcing SEO to India! From cost-effective services and expert professionals to round-the-clock work advantages, learn how your business can achieve digital success with Indian SEO solutions.
Gen Z and the marketplaces - let's translate their needsLaura Szabó
The product workshop focused on exploring the requirements of Generation Z in relation to marketplace dynamics. We delved into their specific needs, examined the specifics in their shopping preferences, and analyzed their preferred methods for accessing information and making purchases within a marketplace. Through the study of real-life cases , we tried to gain valuable insights into enhancing the marketplace experience for Generation Z.
The workshop was held on the DMA Conference in Vienna June 2024.
4. Dependency injection:
public class SomeClient {
private final SomeService mSomeService;
public SomeClient() {
mSomeService = new SomeService();
}
}
public class SomeClient {
private final SomeService mSomeService;
public SomeClient(SomeService someService) {
mSomeService = someService;
}
}
That’s bad because UNIT TESTS That’s good because UNIT TESTS
6. Dependency injection puzzler #1:
public class DataAggregator {
private final List<Data> mData;
public SomeClient() {
mData = new LinkedList<>();
}
public void addData(Data data) {
mData.add(data);
}
public List<Data> getAllData() {
return mData;
}
}
Does this violate dependency injection principles?
7. Dependency injection puzzler #2:
public class SomeClient {
private final SomeService1 mSomeService1;
private final SomeService2 mSomeService2;
public SomeClient(ServiceLocator serviceLocator) {
mSomeService1 = serviceLocator.getService(SomeService1.class);
mSomeService2 = serviceLocator.getService(SomeService2.class);
}
}
Constructor argument, so everything is kosher, right?
20. Warning about dependency injection frameworks:
“… I don’t want [Dependency Injection]
framework code smeared all through my
application. I want to keep frameworks
nicely decoupled and at arms-length from
the main body of my code. I don’t want to
have @Inject attributes everywhere and
bind calls hidden under rocks.”
- Robert “Uncle Bob” Martin
23. Don’t violate the Law of Demeter:
public class SomeClient {
private final SharedPreferences mSharedPreferences;
public SomeClient(Context context) {
mSharedPreferences = context.getSharedPreferences("prefs", Context.MODE_PRIVATE);
}
}
public class SomeClient {
private final SharedPreferences mSharedPreferences;
public SomeClient(SharedPreferences sharedPreferences) {
mSharedPreferences = sharedPreferences;
}
}