SOLID principles outline best practices for software design and architecture. They include:
S: Single responsibility principle - A class should have one clearly defined responsibility.
O: Open-closed principle - Software entities should be open for extension but closed for modification.
L: Liskov substitution principle - Objects should be replaceable with their subtypes without altering functionality.
The document provides examples to illustrate how to apply each principle in software design.
Tim Berners-Lee imagined the World Wide Web as a space for interconnecting documents through hyperlinks. He created HTML to provide the structure and formatting for documents, CSS for presentation, and JavaScript for interactivity. These three languages work together to display content on the web. HTML uses tags to mark up content like paragraphs, headings, and images. CSS controls how content is styled and presented using selectors, rules and property-value pairs. It can be linked via external stylesheets, embedded in HTML, or used inline. JavaScript adds interactive behaviors to webpages.
The document discusses Microsoft MVC and JavaScript tools for building asynchronous web applications. It covers the Ajax.ActionLink and Ajax.BeginForm helpers for making AJAX calls from links and forms, the options for configuring AJAX behavior like events, and how the helpers generate HTML attributes for the unobtrusive AJAX script to handle requests.
This document provides an overview of Angular and TypeScript. It begins with an introduction to Angular and its features like cross-platform support, speed, productivity tools, and full development story. It then compares Angular, AngularJS, and React. Next it discusses tools like NodeJS, Angular CLI, and Visual Studio Code. It covers TypeScript fundamentals like data types, variables, functions, tuples, unions, interfaces, classes, namespaces and modules. It explains Angular architecture components like components, directives, routes, services and NgModule. Finally, it wraps up with a discussion of components in Angular and the topics that will be covered in the next session.
Object Oriented Programming Basics with PHPDaniel Kline
The document provides an introduction to object-oriented programming (OOP) concepts using PHP. It defines OOP and how it relates to procedural programming. Key concepts covered include classes, objects, properties, methods, scopes (public and private), constants, copying and cloning objects. Code examples are provided to demonstrate creating a User class with properties like email and password, and methods to set, get, validate and hash password values. The examples show how to properly encapsulate data within classes and control access to properties and methods using public and private scopes.
Dependency injection is a design pattern that allows classes to have their dependencies satisfied externally rather than internally. It promotes loose coupling between classes and makes code more organized and flexible. Bean management allows the dependency injection framework to automatically instantiate objects and their dependencies rather than requiring manual setup. Inversion of control inverts traditional object creation by allowing external configuration to determine default property values and dependencies rather than coding them. Aspect oriented programming allows cross-cutting concerns like logging or error handling to be defined separately from the core functionality they apply to.
Domain Driven Design (DDD) is a topic that's been gaining a lot of popularity in both the Java and .NET camps recently. Entities, value types, repositories, bounded contexts and anti-corruption layers -- find out what all the buzz is about, and how establishing a domain model can help you combat complexity in your code.
Richard Dingwall is a .NET developer and blogger with a passion for architecture and maintainable code.
He is currently working at Provoke Solutions as lead developer on a six-month project introducing test-driven development (TDD) and domain-driven design (DDD) to a large ASP.NET ERP system.
An hour-long talk given at Wellington .NET user group, Sept 23 2009.
The document discusses creating custom tags in JavaServer Pages (JSP) that support looping functionality. It describes how to create a custom "forEach" tag that can iterate over arrays and assign each element to a scoped variable specified by the "var" attribute. Code examples demonstrate a tag handler class, tag library descriptor (TLD) file, and JSP usage of the new tag.
This document discusses domain-driven design (DDD) as an approach to tackling complexity in software development. DDD focuses on mapping business domain concepts directly into code in order to create software that reflects the business domain rather than frameworks. This is achieved through building a domain model using techniques such as defining entities, value objects, aggregates, repositories, factories and services to encapsulate business logic within the domain layer. Context mapping is also discussed as a way to delineate different bounded contexts and model variations between them.
Tim Berners-Lee imagined the World Wide Web as a space for interconnecting documents through hyperlinks. He created HTML to provide the structure and formatting for documents, CSS for presentation, and JavaScript for interactivity. These three languages work together to display content on the web. HTML uses tags to mark up content like paragraphs, headings, and images. CSS controls how content is styled and presented using selectors, rules and property-value pairs. It can be linked via external stylesheets, embedded in HTML, or used inline. JavaScript adds interactive behaviors to webpages.
The document discusses Microsoft MVC and JavaScript tools for building asynchronous web applications. It covers the Ajax.ActionLink and Ajax.BeginForm helpers for making AJAX calls from links and forms, the options for configuring AJAX behavior like events, and how the helpers generate HTML attributes for the unobtrusive AJAX script to handle requests.
This document provides an overview of Angular and TypeScript. It begins with an introduction to Angular and its features like cross-platform support, speed, productivity tools, and full development story. It then compares Angular, AngularJS, and React. Next it discusses tools like NodeJS, Angular CLI, and Visual Studio Code. It covers TypeScript fundamentals like data types, variables, functions, tuples, unions, interfaces, classes, namespaces and modules. It explains Angular architecture components like components, directives, routes, services and NgModule. Finally, it wraps up with a discussion of components in Angular and the topics that will be covered in the next session.
Object Oriented Programming Basics with PHPDaniel Kline
The document provides an introduction to object-oriented programming (OOP) concepts using PHP. It defines OOP and how it relates to procedural programming. Key concepts covered include classes, objects, properties, methods, scopes (public and private), constants, copying and cloning objects. Code examples are provided to demonstrate creating a User class with properties like email and password, and methods to set, get, validate and hash password values. The examples show how to properly encapsulate data within classes and control access to properties and methods using public and private scopes.
Dependency injection is a design pattern that allows classes to have their dependencies satisfied externally rather than internally. It promotes loose coupling between classes and makes code more organized and flexible. Bean management allows the dependency injection framework to automatically instantiate objects and their dependencies rather than requiring manual setup. Inversion of control inverts traditional object creation by allowing external configuration to determine default property values and dependencies rather than coding them. Aspect oriented programming allows cross-cutting concerns like logging or error handling to be defined separately from the core functionality they apply to.
Domain Driven Design (DDD) is a topic that's been gaining a lot of popularity in both the Java and .NET camps recently. Entities, value types, repositories, bounded contexts and anti-corruption layers -- find out what all the buzz is about, and how establishing a domain model can help you combat complexity in your code.
Richard Dingwall is a .NET developer and blogger with a passion for architecture and maintainable code.
He is currently working at Provoke Solutions as lead developer on a six-month project introducing test-driven development (TDD) and domain-driven design (DDD) to a large ASP.NET ERP system.
An hour-long talk given at Wellington .NET user group, Sept 23 2009.
The document discusses creating custom tags in JavaServer Pages (JSP) that support looping functionality. It describes how to create a custom "forEach" tag that can iterate over arrays and assign each element to a scoped variable specified by the "var" attribute. Code examples demonstrate a tag handler class, tag library descriptor (TLD) file, and JSP usage of the new tag.
This document discusses domain-driven design (DDD) as an approach to tackling complexity in software development. DDD focuses on mapping business domain concepts directly into code in order to create software that reflects the business domain rather than frameworks. This is achieved through building a domain model using techniques such as defining entities, value objects, aggregates, repositories, factories and services to encapsulate business logic within the domain layer. Context mapping is also discussed as a way to delineate different bounded contexts and model variations between them.
Hibernate working with criteria- Basic IntroductionEr. Gaurav Kumar
This document provides an introduction to using the Hibernate Criteria API for building query objects programmatically. It demonstrates how to create a Criteria object from a Session, add restrictions and conditions, combine restrictions with logical operators, sort results, and perform aggregate functions and projections. The main advantage of the Criteria API over HQL is that it provides a cleaner, more object-oriented and type-safe approach to querying compared to plain HQL.
Techlunch - Dependency Injection with VaadinPeter Lehto
The document discusses dependency injection (DI) with programmatic configuration. It defines DI as a mechanism where dependencies between objects are not directly created but instead satisfied by a third party - a DI container. The document outlines reasons for using DI including loose coupling and inversion of control. It provides examples of DI in Java using annotations and explains concepts such as scopes, producers and programmatic configuration. It also discusses integrating DI into Vaadin applications using CDI extensions.
“Program to an interface, not an implementation” they[1] say …
But when IMyInterface foo = new IMyInterface() is not valid code … how are you supposed to achieve that ? The answer is Dependency Injection.
In this talk, we’ll talk about Dependency injection, what it is and what it is not. We’ll see how it is a valuable set of practices and patterns that help design maintainable software built on top of the SOLID object-oriented principles.
We’ll see how, when used properly, it delivers many benefits such as extensibility and testability … We’ll also cover some anti-patterns, ways of using Dependency Injection that can lead to code that is painful to understand and maintain
This talk is not about DI/IOC containers per se, but focuses on the core concepts of Dependency Injection. Those concepts are essential to understand how to use those “magic-looking” tools (if they are needed at all …)
This talk is not only for .NET developers. It will contain code examples written in C#, but should be understandable by developers with knowledge in other statically-typed object-oriented languages such as Java, Vb.NET, C++ …
CDI provides standards-based and typesafe dependency injection in Java EE 6. It integrates well with other Java EE 6 technologies like EJB, JPA, JSF, and JAX-WS. Portable extensions facilitate a richer programming model. Weld is the reference implementation of CDI and is integrated into application servers like GlassFish and JBoss.
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoHasnain Iqbal
This document provides an overview of the evolution of data access application programming interfaces (APIs) used in Microsoft technologies, including ADO.NET 1.0, LINQ, and the ADO.NET Entity Framework. It discusses the goals and features of each API, how they address challenges in working with data, and how they improved developer productivity. It also describes the architecture and components of the Entity Framework, how it maps object and relational models, and techniques for customizing data mappings.
Explore how you can easily add advanced functionality to your web projects by adding jQuery. JQuery for web development
https://www.udemy.com/web-development-introduction-to-jquery/?couponCode=SLIDESHARE
Binding business data to vaadin componentsPeter Lehto
There are two main differences between setPropertyDataSource() and setContainerDataSource() for Vaadin components:
1. Data source type - setPropertyDataSource() binds the component to a single property, while setContainerDataSource() binds it to a full Container which can contain multiple items and properties.
2. Data binding - setPropertyDataSource() binds the component value to a specific property of the current item. setContainerDataSource() does not directly bind the component, it just sets the container as the available options but does not automatically select any value. The component does not know which property in the container to use as the value.
So in summary:
- setPropertyDataSource() binds a single component to a specific property
This document discusses JavaScript fundamentals like variables, data types, objects, and functions. It then covers topics related to organizing JavaScript code including modularization, dependency management, and bundling. Modularization is introduced as a way to organize code into independent and reusable modules. Dependency management with LoadRunner and AMD is presented for loading modules and their dependencies. Bundling is described as a way to merge modules into a single file to reduce HTTP requests. Code examples are provided for many of the concepts and techniques discussed.
Domain Driven Design and Hexagonal Architecture with RailsDeclan Whelan
You know that Domain Driven Design, Hexagonal Architecture, and the Single Responsibility Principle are important but it’s hard to know how to best apply them to Rails applications. Following the path of least-resistance will get you in trouble. In this session you will learn a way out of the “fat model, skinny controller” hell. You will leave with a roadmap to guide your design based on concepts from Domain Driven Design and Hexagonal Architecture.
The document discusses how to prevent JavaScript injection attacks in ASP.NET MVC applications. It describes a customer feedback website that is vulnerable to JavaScript injection by displaying user-submitted content without encoding. It then presents two approaches to prevent this: 1) HTML encoding user data when displayed in views, and 2) HTML encoding user data before saving to the database in controllers. Encoding replaces dangerous HTML characters to neutralize malicious JavaScript while preserving the data's meaning.
Next Generation in Government Summit - Dealing with Being a Boss for the 1st ...Dan Pons
This document discusses challenges new bosses may face and strategies for being an outstanding boss. It identifies four key challenges: 1) having enough knowledge to be a good but not outstanding boss, 2) needing additional resources beyond basic agency support, 3) teams being unwilling to provide honest feedback, and 4) difficulty delivering constructive feedback. The document provides suggestions for addressing each challenge, such as consulting books, publications and websites, establishing a network of experienced leaders, gaining honest feedback anonymously, and spending time preparing specific, measurable feedback focused on improvement.
This document provides definitions and explanations of key concepts related to states of matter, phase changes, properties of matter, and chemical and physical changes. It defines solids, liquids, gases and plasma, and how their particle motion and arrangement differs. It also explains concepts like temperature, pressure, changes of state, heat of fusion/vaporization, buoyancy, and mixtures and solutions. Key terms defined include homogeneous and heterogeneous mixtures, physical and chemical changes, and flammability.
Nuclear energy is released through nuclear fission when the nucleus of an atom breaks apart. This energy is then converted to electrical energy in a nuclear reactor. While nuclear power produces low carbon emissions, there are environmental and safety risks such as radioactive waste and potential radiation leaks from accidents like the 1986 Chernobyl disaster where a reactor exploded, exposing over 260,000 people to radiation and causing 28 deaths from acute radiation sickness.
The document outlines 18 slides from a presentation on project management 101. It discusses the four key elements that must be managed: resources, time, money, and scope. Scope is identified as the most important and can impact all other elements. A 14-step process for managing projects is then outlined, beginning with defining the scope and ending with keeping all stakeholders informed of progress. The presentation emphasizes that successful project management requires balancing all elements and being prepared to adjust plans as needed.
The document discusses acids and bases. It defines acids as substances that produce hydrogen ions (H+) in water and lists common acids like hydrochloric acid. It defines bases as substances that produce hydroxide ions (OH-) in water and lists common bases like sodium hydroxide. It discusses how some acids and bases only partially dissociate or break down in water, while others fully dissociate. It also covers pH, neutralization reactions between acids and bases, and indicators used to test acids and bases.
The scientific method is an approach used to investigate a scientific problem and consists of several key steps: (1) asking a question and conducting research; (2) developing a hypothesis; (3) performing experiments to test the hypothesis; (4) collecting and analyzing data from the experiments; and (5) sharing results and developing a theory or law to explain the findings. The scientific method relies on objective measurement and evidence from experiments in which variables are controlled to test hypotheses and develop theories.
Nonmetals have properties of being brittle solids or gases, are dull in color, and are poor conductors of heat and electricity. Hydrogen is the only nonmetal on the left side of the periodic table and exists as a diatomic hydrogen molecule made of two hydrogen atoms. Nonmetals include the halogens of fluorine, chlorine, bromine, iodine and astatine as well as the noble gases of helium, neon, argon, krypton, xenon and radon, which are stable with a full outer electron shell of eight electrons.
The document discusses different measurement units and how to measure various quantities:
1. It lists common base units for mass (gram), volume (liter), length/width/height/depth (meter), and temperature (Celsius).
2. Methods are described for measuring mass using a scale, volume using a graduated cylinder, length/width using a ruler or tape measure, and temperature using a thermometer.
3. Examples are provided for calculating the mass of an object, volume of water, length in centimeters and millimeters, and temperatures.
The document discusses a problem where durations imported from Primavera into Acumen Fuse are incorrectly translated as three times longer than the original durations. This is caused by a default setting in Acumen Fuse that uses 8 hours per day instead of respecting the assigned calendars. The solution is to check the "Hours per Time Period" box under the Activity View settings before importing, which will make Acumen Fuse use the assigned calendars correctly. Not checking this box can lead to inaccurate schedule metrics in Acumen Fuse.
In January 2015, there were 46 listenings with 2 new and 5 active volunteers. There were 2 house meetings with 48 attendees and 1 project meeting with 6 attendees. 2 training sessions were held with 6 total attendees. Positive progress was made on a tenants' health and safety issues. One volunteer dropped out and a project was cancelled due to personal issues. The team is developing slowly through ongoing training. The author met a group feeding the homeless and is helping them formalize and obtain funding.
Velocity describes both the speed and direction of an object, and can change due to changes in speed or direction, such as a car rounding a curve. Acceleration is the rate of change of velocity, and can occur through changes in speed or direction - positive acceleration occurs when acceleration is in the same direction as velocity, causing an increase in speed, while negative acceleration or deceleration occurs when acceleration is in the opposite direction of velocity, causing a decrease in speed. Acceleration depends on both the change in velocity over time - the time interval is the period over which the change in velocity took place.
Hibernate working with criteria- Basic IntroductionEr. Gaurav Kumar
This document provides an introduction to using the Hibernate Criteria API for building query objects programmatically. It demonstrates how to create a Criteria object from a Session, add restrictions and conditions, combine restrictions with logical operators, sort results, and perform aggregate functions and projections. The main advantage of the Criteria API over HQL is that it provides a cleaner, more object-oriented and type-safe approach to querying compared to plain HQL.
Techlunch - Dependency Injection with VaadinPeter Lehto
The document discusses dependency injection (DI) with programmatic configuration. It defines DI as a mechanism where dependencies between objects are not directly created but instead satisfied by a third party - a DI container. The document outlines reasons for using DI including loose coupling and inversion of control. It provides examples of DI in Java using annotations and explains concepts such as scopes, producers and programmatic configuration. It also discusses integrating DI into Vaadin applications using CDI extensions.
“Program to an interface, not an implementation” they[1] say …
But when IMyInterface foo = new IMyInterface() is not valid code … how are you supposed to achieve that ? The answer is Dependency Injection.
In this talk, we’ll talk about Dependency injection, what it is and what it is not. We’ll see how it is a valuable set of practices and patterns that help design maintainable software built on top of the SOLID object-oriented principles.
We’ll see how, when used properly, it delivers many benefits such as extensibility and testability … We’ll also cover some anti-patterns, ways of using Dependency Injection that can lead to code that is painful to understand and maintain
This talk is not about DI/IOC containers per se, but focuses on the core concepts of Dependency Injection. Those concepts are essential to understand how to use those “magic-looking” tools (if they are needed at all …)
This talk is not only for .NET developers. It will contain code examples written in C#, but should be understandable by developers with knowledge in other statically-typed object-oriented languages such as Java, Vb.NET, C++ …
CDI provides standards-based and typesafe dependency injection in Java EE 6. It integrates well with other Java EE 6 technologies like EJB, JPA, JSF, and JAX-WS. Portable extensions facilitate a richer programming model. Weld is the reference implementation of CDI and is integrated into application servers like GlassFish and JBoss.
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoHasnain Iqbal
This document provides an overview of the evolution of data access application programming interfaces (APIs) used in Microsoft technologies, including ADO.NET 1.0, LINQ, and the ADO.NET Entity Framework. It discusses the goals and features of each API, how they address challenges in working with data, and how they improved developer productivity. It also describes the architecture and components of the Entity Framework, how it maps object and relational models, and techniques for customizing data mappings.
Explore how you can easily add advanced functionality to your web projects by adding jQuery. JQuery for web development
https://www.udemy.com/web-development-introduction-to-jquery/?couponCode=SLIDESHARE
Binding business data to vaadin componentsPeter Lehto
There are two main differences between setPropertyDataSource() and setContainerDataSource() for Vaadin components:
1. Data source type - setPropertyDataSource() binds the component to a single property, while setContainerDataSource() binds it to a full Container which can contain multiple items and properties.
2. Data binding - setPropertyDataSource() binds the component value to a specific property of the current item. setContainerDataSource() does not directly bind the component, it just sets the container as the available options but does not automatically select any value. The component does not know which property in the container to use as the value.
So in summary:
- setPropertyDataSource() binds a single component to a specific property
This document discusses JavaScript fundamentals like variables, data types, objects, and functions. It then covers topics related to organizing JavaScript code including modularization, dependency management, and bundling. Modularization is introduced as a way to organize code into independent and reusable modules. Dependency management with LoadRunner and AMD is presented for loading modules and their dependencies. Bundling is described as a way to merge modules into a single file to reduce HTTP requests. Code examples are provided for many of the concepts and techniques discussed.
Domain Driven Design and Hexagonal Architecture with RailsDeclan Whelan
You know that Domain Driven Design, Hexagonal Architecture, and the Single Responsibility Principle are important but it’s hard to know how to best apply them to Rails applications. Following the path of least-resistance will get you in trouble. In this session you will learn a way out of the “fat model, skinny controller” hell. You will leave with a roadmap to guide your design based on concepts from Domain Driven Design and Hexagonal Architecture.
The document discusses how to prevent JavaScript injection attacks in ASP.NET MVC applications. It describes a customer feedback website that is vulnerable to JavaScript injection by displaying user-submitted content without encoding. It then presents two approaches to prevent this: 1) HTML encoding user data when displayed in views, and 2) HTML encoding user data before saving to the database in controllers. Encoding replaces dangerous HTML characters to neutralize malicious JavaScript while preserving the data's meaning.
Next Generation in Government Summit - Dealing with Being a Boss for the 1st ...Dan Pons
This document discusses challenges new bosses may face and strategies for being an outstanding boss. It identifies four key challenges: 1) having enough knowledge to be a good but not outstanding boss, 2) needing additional resources beyond basic agency support, 3) teams being unwilling to provide honest feedback, and 4) difficulty delivering constructive feedback. The document provides suggestions for addressing each challenge, such as consulting books, publications and websites, establishing a network of experienced leaders, gaining honest feedback anonymously, and spending time preparing specific, measurable feedback focused on improvement.
This document provides definitions and explanations of key concepts related to states of matter, phase changes, properties of matter, and chemical and physical changes. It defines solids, liquids, gases and plasma, and how their particle motion and arrangement differs. It also explains concepts like temperature, pressure, changes of state, heat of fusion/vaporization, buoyancy, and mixtures and solutions. Key terms defined include homogeneous and heterogeneous mixtures, physical and chemical changes, and flammability.
Nuclear energy is released through nuclear fission when the nucleus of an atom breaks apart. This energy is then converted to electrical energy in a nuclear reactor. While nuclear power produces low carbon emissions, there are environmental and safety risks such as radioactive waste and potential radiation leaks from accidents like the 1986 Chernobyl disaster where a reactor exploded, exposing over 260,000 people to radiation and causing 28 deaths from acute radiation sickness.
The document outlines 18 slides from a presentation on project management 101. It discusses the four key elements that must be managed: resources, time, money, and scope. Scope is identified as the most important and can impact all other elements. A 14-step process for managing projects is then outlined, beginning with defining the scope and ending with keeping all stakeholders informed of progress. The presentation emphasizes that successful project management requires balancing all elements and being prepared to adjust plans as needed.
The document discusses acids and bases. It defines acids as substances that produce hydrogen ions (H+) in water and lists common acids like hydrochloric acid. It defines bases as substances that produce hydroxide ions (OH-) in water and lists common bases like sodium hydroxide. It discusses how some acids and bases only partially dissociate or break down in water, while others fully dissociate. It also covers pH, neutralization reactions between acids and bases, and indicators used to test acids and bases.
The scientific method is an approach used to investigate a scientific problem and consists of several key steps: (1) asking a question and conducting research; (2) developing a hypothesis; (3) performing experiments to test the hypothesis; (4) collecting and analyzing data from the experiments; and (5) sharing results and developing a theory or law to explain the findings. The scientific method relies on objective measurement and evidence from experiments in which variables are controlled to test hypotheses and develop theories.
Nonmetals have properties of being brittle solids or gases, are dull in color, and are poor conductors of heat and electricity. Hydrogen is the only nonmetal on the left side of the periodic table and exists as a diatomic hydrogen molecule made of two hydrogen atoms. Nonmetals include the halogens of fluorine, chlorine, bromine, iodine and astatine as well as the noble gases of helium, neon, argon, krypton, xenon and radon, which are stable with a full outer electron shell of eight electrons.
The document discusses different measurement units and how to measure various quantities:
1. It lists common base units for mass (gram), volume (liter), length/width/height/depth (meter), and temperature (Celsius).
2. Methods are described for measuring mass using a scale, volume using a graduated cylinder, length/width using a ruler or tape measure, and temperature using a thermometer.
3. Examples are provided for calculating the mass of an object, volume of water, length in centimeters and millimeters, and temperatures.
The document discusses a problem where durations imported from Primavera into Acumen Fuse are incorrectly translated as three times longer than the original durations. This is caused by a default setting in Acumen Fuse that uses 8 hours per day instead of respecting the assigned calendars. The solution is to check the "Hours per Time Period" box under the Activity View settings before importing, which will make Acumen Fuse use the assigned calendars correctly. Not checking this box can lead to inaccurate schedule metrics in Acumen Fuse.
In January 2015, there were 46 listenings with 2 new and 5 active volunteers. There were 2 house meetings with 48 attendees and 1 project meeting with 6 attendees. 2 training sessions were held with 6 total attendees. Positive progress was made on a tenants' health and safety issues. One volunteer dropped out and a project was cancelled due to personal issues. The team is developing slowly through ongoing training. The author met a group feeding the homeless and is helping them formalize and obtain funding.
Velocity describes both the speed and direction of an object, and can change due to changes in speed or direction, such as a car rounding a curve. Acceleration is the rate of change of velocity, and can occur through changes in speed or direction - positive acceleration occurs when acceleration is in the same direction as velocity, causing an increase in speed, while negative acceleration or deceleration occurs when acceleration is in the opposite direction of velocity, causing a decrease in speed. Acceleration depends on both the change in velocity over time - the time interval is the period over which the change in velocity took place.
There are three main types of mirrors: plane, concave, and convex. Plane mirrors create virtual upright images of the same size as the object. Concave mirrors bring light rays together to form real images that are either smaller and upside down if behind the focal point, or nonexistent at the focal point. Convex mirrors spread light rays apart to create virtual upright but smaller images.
There are two main types of chemical bonds: ionic bonds and covalent bonds. Ionic bonds involve the transfer of electrons between ions of different elements to achieve a full outer shell, such as between magnesium and oxygen. Covalent bonds involve the sharing of electrons between atoms of the same or different elements to achieve a full outer shell, such as between two chlorine atoms to form diatomic chlorine.
Physical properties are observable characteristics of matter like color, shape, size, and temperature, while chemical properties determine how a substance will change. A physical change alters a substance's appearance through breaking, sublimation, or evaporation without changing its identity, whereas a chemical change transforms one substance into another through processes like burning or rusting. The law of conservation of mass states that the total mass of the reactants and products remains the same during any chemical change.
The document discusses the three main ways that the state of matter can change: evaporation, sublimation, and condensation. Evaporation occurs when a liquid turns to a gas above its boiling point, sublimation is when a solid turns directly to a gas, and condensation is when a gas turns to a liquid below its boiling point. It also defines heat of fusion as the energy needed to change from solid to liquid, and heat of vaporization as the energy needed to change from liquid to gas, noting that changing from solid to liquid requires less energy for water.
Este documento presenta información sobre el nuevo enfoque de mejora en el contexto de la reforma educacional chilena. Explica que el objetivo es brindar oportunidades de aprendizaje integral para todos sin distinción y garantizar la calidad a través de la gestión institucional y los procesos pedagógicos. Las herramientas claves son el Proyecto Educativo Institucional y el Plan de Mejoramiento, que guían la mejora estratégica de los establecimientos educativos. El documento también describe los componentes y etapas del
The document provides an overview of the SOLID principles of software architecture:
- S is for the Single Responsibility Principle, which states that a class should have one and only one responsibility.
- O is for the Open-Closed Principle, which states that software entities should be open for extension but closed for modification. This allows adding new behavior without changing existing code.
- L is for the Liskov Substitution Principle, which requires objects in a program to be replaceable with instances of their subtypes without altering the correctness of that program.
- I is for the Interface Segregation Principle, which states that no client should be forced to depend on methods it does not use
This document provides an overview and examples of the SOLID principles of object-oriented design:
- SRP (Single Responsibility Principle) states that a class should have one, and only one, reason to change. Examples show extracting validation and email sending logic into separate classes.
- OCP (Open-Closed Principle) states that software entities should be open for extension but closed for modification. Examples use inheritance and interfaces to add new filtering logic without modifying existing classes.
- LSP (Liskov Substitution Principle) states that subclasses must be substitutable for their base classes. Examples show invalid implementations that break the base class contract.
- ISP (Interface Segregation Principle
This document provides an overview of dependency injection (DI) and how it is implemented in Drupal 8. It begins by explaining DI as a design pattern that allows code to be more reusable, testable and ignorant of dependencies. It then discusses how frameworks like Symfony implement DI using a service container that is configured to inject dependencies. In Drupal 8, services are defined in YAML files and the container is configured using compiler passes. Core services can be accessed directly or by wiring classes into the container as event subscribers or using a factory method for controllers.
This document provides guidance on an exercise to learn encapsulation and abstraction using C#. It instructs the reader to create a class called Employee with private member variables for ID and salary, and public properties to access these values. An event handler is created to instantiate an Employee object, set the property values, and display them, demonstrating encapsulation. The document further explains abstraction by describing how a class represents all behaviors and properties of an entity. It also discusses other access modifiers like protected.
The document discusses reviewing object-oriented design patterns. It begins with definitions of design patterns and their history. It then covers the core tenets of OOP like encapsulation, abstraction, inheritance, polymorphism. Specific patterns like singleton, command, and dependency injection are explained with examples. The document stresses principles for good design like avoiding duplication, loose coupling, single responsibility.
Object Oriented Programming In JavaScriptForziatech
This document provides an overview of object oriented programming concepts in JavaScript. It discusses how JavaScript supports OOP through prototypes, functions acting as classes, and constructor functions to initialize objects. The document also covers data types in JavaScript, error handling using try/catch blocks, and techniques to improve performance such as reducing DOM access and unnecessary variables. It provides examples of implementing inheritance, abstraction, polymorphism, and other OOP principles in JavaScript.
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaUgo Matrangolo
ScalDI is a lightweight dependency injection (DI) framework for Scala that provides an alternative to the "Cake Pattern" approach. It defines three main concepts - Injector, Module, and Injectable - that make DI easier to use and understand compared to the Cake Pattern. Modules are used to define bindings between types and implementations using a simple DSL. The Injectable trait allows dependencies to be injected into classes in a type-safe manner. ScalDI also supports features like conditional bindings, constructor injection, lifecycle management, and integration with Play and Akka.
The document discusses several principles of object-oriented programming including:
1. The Single Responsibility Principle which states that classes should have single responsibilities and separates the logging functionality.
2. The Open Closed Principle which makes classes open for extension but closed for modification through inheritance.
3. The Liskov Substitution Principle allows subclasses to behave in the same way as the parent class.
4. The Interface Segregation Principle splits interfaces that are very large into smaller and more specific ones for easier implementation.
5. The Dependency Inversion Principle states that high-level modules should not depend on low-level modules but both should depend on abstractions. This allows for looser coupling
This document provides instructions for connecting an SQLite database to an Android application using Android Studio. It describes creating a database using SQLite Manager and placing it in the Android project's assets folder. It then explains creating a Connection class with paths to the database folder and file. The document outlines creating a DataDB class to connect to the Connection class and calling getNameDB in the MainActivity to retrieve the database name. It provides code snippets for the Connection and DataDB classes.
This document provides guidance on a programming primer for encapsulation and abstraction using VB in ASP.NET. It discusses creating an Employee class with private member variables for ID and salary, along with public properties to access these privately. The example shows how to set property values and output them, demonstrating encapsulation. It also explains how abstraction relates to classes representing conceptual models without physical form. The document concludes with exercises on using different access modifiers like private, public, and protected.
Still Comparing "this" Pointer to Null?Andrey Karpov
This is a translation of an article written by Dmitry Meshcheryakov, an ABBYY employee and first published here: "ABBYY blog. Still Comparing "this" Pointer to Null?". Translation done and published with permission of the copyright holder.
Presentation on building a shopping cart using Java with XPages by Graham Acres and myself at the 2014 Midwest Lotus User Group Conference (MWLUG). We include the thinking behind the code to help with the Java journey.
The document discusses JavaScript statements, functions, arrays, and objects. It provides examples of JavaScript code and explains key concepts like:
- JavaScript statements are separated by semicolons and can span multiple lines.
- Functions are blocks of code that perform tasks and can accept parameters and return values.
- Arrays are special variables that can hold multiple values accessed by index.
- Objects store properties and methods, with properties being name-value pairs that can be accessed directly or via methods.
The document discusses best practices for testing Rails controllers. It recommends writing declarative tests that focus on authentication, authorization, resource presence, and responses. Shared examples should be used to DRY up tests for these "small details". Tests for "big actions" like fetching a resource can be simple. Business logic belongs in models, not controllers. ActiveModel makes it easy to extract logic out of controllers and into reusable classes. Overall, the goal is to keep controllers simple and focused on their main responsibilities by writing declarative, well-factored tests.
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 discusses code refactoring techniques in Visual Studio 2015, including inline temporary variables and introducing local variables. It provides an example C# class with a method to fetch products above a certain price, and shows how Visual Studio's code refactoring suggestions can optimize the method in multiple steps. These include removing temporary variables, converting the method to an expression-bodied member, and reducing the code to a single line. The document emphasizes that code refactoring requires an understanding of how the changes will affect the code.
Build an App with JavaScript and jQuery - LA - July 18Thinkful
This document provides an overview and agenda for a workshop on building an app with JavaScript and jQuery. The workshop will introduce JavaScript and jQuery concepts like DOM manipulation and event handling. Attendees will then work to build a shopping list app by adding, removing, and updating items. The agenda includes reviewing starter code, learning key concepts, building the app with help from TAs, reviewing solutions, and discussing next steps for continued learning.
Build an App with JavaScript and jQuery - LA - July 18
SOLID_WriteUp
1. SOLID Principles
Introduction
My goal of writing this content is to understand “SOLID”
using simple “customer class” example.
What is SOLID?
SOLID are five basic principles which help to create good
software architecture.
S stands for SRP (Single responsibility principle
O stands for OCP (Open closed principle)
L stands for LSP (Liskov substitution principle)
I stands for ISP ( Interface segregation principle)
D stands for DIP ( Dependency inversion principle)
Let’s start understanding each principle.
The best way to understand SOLID is by understanding
what problem it tries to solve.
“S”- SRP (Single responsibility principle)
Have a look at the code below, and guess what the
problem ?
class Customer
{
public void Add()
{
try
{
//Some code goes here
}
catch (Exception ex)
{
System.IO.File.WriteAllText(@"c:Error.txt",
ex.ToString());
}
}
}
2. Customer class should do customer data validations like
call the customer data access layer etc , but if you see the
catch block it also doing LOG activity. In simple words its over
loaded with lot of responsibility. So tomorrow if add a new
logger like event viewer I need to go and change the
“Customer”class, that’s not correct.
“If one of them needs to be changed the whole set
needs to be disturbed.”
But if we can have each of those items separated its
simple, easy to maintain and one change does not affect the
other. The same principle also applies to classes and objects in
software architecture.
So SRP says that a class should have only one
responsibility and not multiple.So if we apply SRP we can move
that logging activity to some other class who will only look
after logging activities.
class FileLogger
{
public void Handle(string error)
{
System.IO.File.WriteAllText(@"c:Error.txt", error);
}
}
Now customer class can happily delegate the logging
activity to the “FileLogger” class and he can concentrate on
customer related activities.
class Customer
{
private FileLogger obj = new FileLogger();
public virtual void Add()
{
try
{
// code goes here
}
catch (Exception ex)
{
obj.Handle(ex.ToString());
}
}
}
3. “O” - Open closed principle
I have added a simple customer type property to the
class.This property decided if this is a “Gold” or a “Silver”
customer.Depending on the type property it calculates
discount.
Have a look at the “getDiscount” function which returns
discount accordingly.
1 for Gold customer and 2 for Silver customer.
class Customer
{
private int _CustType;
public int CustType
{
get
{
return _CustType;
}
set
{
_CustType = value;
}
}
public double getDiscount(double TotalSales)
{
if (_CustType == 1)
{
return TotalSales - 100;
}
else
{
return TotalSales - 50;
}
}
}
The problem is if we add a new customer type we need to
go and add one more “IF” condition in the “getDiscount”
function, in other words we need to change the customer class.
If we are changing the customer class again, we need to
ensure that the previous conditions with new one’s are tested
4. again.
In other words we are “MODIFYING” the current customer
code for every change and every time we modify we need to
ensure that all the previous functionalities and connected client
are working as before.
How about rather than “MODIFYING” we go for
“EXTENSION”. In other words every time a new customer type
needs to be added we create a new class as shown in the
below. So whatever is the current code they are untouched and
we just need to test and check the new classes.
class Customer
{
public virtual double getDiscount(double TotalSales)
{
return TotalSales;
}
}
class SilverCustomer : Customer
{
public override double getDiscount(double TotalSales)
{
return base.getDiscount(TotalSales) - 50;
}
}
class goldCustomer : SilverCustomer
{
public override double getDiscount(double TotalSales)
{
return base.getDiscount(TotalSales) - 100;
}
}
Putting in simple words the “Customer” class is now closed
for any new “modification” but it’s open for “extensions” when
new customer types are added to the project.
“L”- LSP (Liskov substitution principle)
Let’s say our system wants to calculate discounts for
Enquiries. Now Enquiries are not actual customer’s they are
just leads. Because they are just leads we do not want to save
5. them for now.
So we create a new class called as Enquiry which inherits
from the “Customer” class. We provide some discounts to the
enquiry so that they can be converted to actual customers and
we override the “Add’ method with an exception so that no one
can add an Enquiry to the database.
class Enquiry : Customer
{
public override double getDiscount(double TotalSales)
{
return base.getDiscount(TotalSales) - 5;
}
public override void Add()
{
throw new Exception("Not allowed");
}
}
The current “Customer” is the parent class with “Gold” ,
“Silver” and “Enquiry” as child classes.
So as per polymorphism rule my parent “Customer” class
object can point to any of it child class objects i.e. “Gold”,
“Silver” or “Enquiry” during runtime without any issues.
So for instance in the below code you can see I have
created a list collection of “Customer” and I can add “Silver” ,
“Gold” and “Enquiry” customer to the “Customer” collection
without any issues.
I can also browse the “Customer” list using the parent
customer object and invoke the “Add” method as shown in the
below code.
List<Customer> Customers = new List<Customer>();
Customers.Add(new SilverCustomer());
Customers.Add(new goldCustomer());
Customers.Add(new Enquiry());
foreach (Customer o in Customers)
{
o.Add();
}
}
6. As per the inheritance hierarchy the “Customer” object can
point to any one of its child objects and we do not expect any
unusual behaviour.
But when “Add” method of the “Enquiry” object is invoked
it leads to below error because our “Equiry” object does save
enquiries to database as they are not actual customers.
“Enquiry” has discount calculation , it looks like a
“Customer” but IT IS NOT A CUSTOMER. So the parent cannot
replace the child enquiry object.
“Customer” is not the actual parent for the
“Enquiry”class.
“Enquiry” is a different entity altogether.
LISKOV principle says the parent should easily replace the
child object. Implement LISKOV we need to create two
interfaces one is for discount and other for database as shown
below.
interface IDiscount
{
double getDiscount(double TotalSales);
}
interface IDatabase
{
void Add();
}
Now the “Enquiry” class will only implement “IDiscount” as
he not interested in the “Add” method.
class Enquiry : IDiscount
{
public double getDiscount(double TotalSales)
{
return TotalSales - 5;
}
}
While the “Customer” class will implement both “IDiscount” as
well as “IDatabase” as it also wants to persist the customer to
the database.
7. class Customer : IDiscount, IDatabase
{
private MyException obj = new MyException();
public virtual void Add()
{
try
{
// Database code goes here
}
catch (Exception ex)
{
obj.Handle(ex.Message.ToString());
}
}
public virtual double getDiscount(double TotalSales)
{
return TotalSales;
}
}
“I” - ISP (Interface Segregation principle)
Assume that our customer class has become a popular
component and it’s consumed across huge clients and they are
very happy using the customer class.
Now some new requirment come up with a demand saying
that we also want a method which will help us to “Read”
customer data.
So we would like to change the “IDatabase” interfaceas
shown below.
interface IDatabase
{
void Add(); // old client are happy with these.
voidRead(); // Added for new clients.
}
The new requirement which has come up, you have two
kinds of client’s: -
1. Who want’s just use “Add” method.
2. Who wants to use “Add” + “Read”.
8. Now by changing the current interface means you are
disturbing the current satisfied client’s , even when they are
not interested in the “Read” method. we are forcing them to
use the “Read” method.
So a better approach would be to keep existing clients as it
is and serve the new client’s separately by creating a new
interface rather than updating the current interface. So we can
keep the current interface “IDatabase” as it is and add a new
interface “IDatabaseV1” with the “Read” method.
interface IDatabaseV1 : IDatabase // Gets the Add method
{
Void Read();
}
Now create fresh classes which implement “Read” method
which satisfies requirements of your new clients and your old
clients stay untouched with the old interface which does not
have “Read” method.
class CustomerwithRead : IDatabase, IDatabaseV1
{
public void Add()
{
Customer obj = new Customer();
Obj.Add();
}
Public void Read()
{
// Implements logic for read
}
}
Now old clients will continue using the “IDatabase”
interface while new client can use “IDatabaseV1” interface.
IDatabase i = new Customer(); // old clients
i.Add();
IDatabaseV1 iv1 = new CustomerWithread(); // new clients
Iv1.Read();
“D”- Dependency inversion principle
9. If you remember we had created a logger class to satisfy
SRP.
class Customer
{
private FileLogger obj = new FileLogger();
public virtual void Add()
{
try
{
// Database code goes here
}
catch (Exception ex)
{
obj.Handle(ex.ToString());
}
}
}
Just to control things we create a common interface.
interface ILogger
{
void Handle(string error);
}
Below are three logger types. 1) FileLogger, 2)
EventViewLogger, 3) EmailLogger.
class FileLogger : ILogger
{
public void Handle(string error)
{
System.IO.File.WriteAllText(@"c:Error.txt", error);
}
}
class EventVieweLogger : ILogger
{
public void Handle(string error)
{
// log errors to event viewer
}
}
class EmailLogger : ILogger
{
public void Handle(string error)
{
// send errors in email
10. }
}
Depending on configuration settings different logger classes
will used at given moment.
For example simple IF condition which decides which logger
class to be used.
class Customer : IDiscount, IDatabase
{
private IException obj;
public virtual void Add(int Exhandle)
{
try
{
// Database code goes here
}
catch (Exception ex)
{
if (Exhandle == 1)
{
obj = new MyException();
}
else
{
obj = new EmailException();
}
obj.Handle(ex.Message.ToString());
}
}
The above code is again violating SRP but this time the
aspect is different ,its about deciding which objects should be
created.
It’s not the work of “Customer” object to decide which
instances to be created , he should be concentrating only on
Customer class related functionalities.
If you observe the biggest problem is the “NEW” keyword
which creates the object. It is taking extra responsibilities of
which object needs to be created.
So if we INVERT / DELEGATE this responsibility to someone
else rather the customer class doing it that would solve the
problem to a certain extent.
We have opened the constructor and we expect someone
else to pass the object rather than the customer class passing
it. So now it’s the responsibility of the client who is consuming
11. the customer object to decide which Logger class to inject.
class Customer : IDiscount, IDatabase
{
private Ilogger obj;
public Customer(ILogger i)
{
obj = i;
}
}
So now the client will inject the Logger object and the
customer object is now free from those IF condition which
decide which logger class to inject.
Customer class has delegated the dependent object
creation to client consuming it thus making the customer class
concentrate on his work.
IDatabase i = new Customer(new EmailLogger());
Revising SOLID principles:
S (Single responsibility principle) :- A class should take care
of only one responsibility.
O (Open closed principle) :- Extension should be
preferred over modification.
L (Liskov substitution principle) :- A parent class object
should be able to refer child objects seamlessly during runtime
polymorphism.
I (Interface segregation principle) :- Client should not be
forced to use a interface if it does not need it.
D (Dependency inversion principle) :- High level modules
should not depend on low level modules but should depend on
abstraction.