This document discusses improving proto types when using them in collections for RPC applications. It recommends adding an empty message type for void parameters and repeatable types for data collections. Sample code shows defining request/response messages for getting a user by name including a repeated field for the user collection. The server code returns the collection while the client code iterates over it. Implementing an online shop sample is suggested along with using the template method pattern for server internal logic. The document recommends a design patterns book and thanks the reader.
This document provides an overview of software quality assurance and testing. It defines quality as meeting specifications and customer expectations. Software testing investigates quality by providing stakeholders information. Testing is important to prevent defects, as shown by examples of bugs that caused spacecraft and airplane failures costing lives and money. Quality assurance focuses on preventing defects through planning and verification, while quality control identifies defects through action and validation. Defects can be costly so issue tracking systems are used to manage bug lifecycles. Manual testing is time-consuming and relies on human resources while automation testing is faster, more reliable and programmable.
This document discusses improving proto types when using them in collections for RPC applications. It recommends adding an empty message type for void parameters and repeatable types for data collections. Sample code shows defining request/response messages for getting a user by name including a repeated field for the user collection. The server code returns the collection while the client code iterates over it. Implementing an online shop sample is suggested along with using the template method pattern for server internal logic. The document recommends a design patterns book and thanks the reader.
This document provides an overview of software quality assurance and testing. It defines quality as meeting specifications and customer expectations. Software testing investigates quality by providing stakeholders information. Testing is important to prevent defects, as shown by examples of bugs that caused spacecraft and airplane failures costing lives and money. Quality assurance focuses on preventing defects through planning and verification, while quality control identifies defects through action and validation. Defects can be costly so issue tracking systems are used to manage bug lifecycles. Manual testing is time-consuming and relies on human resources while automation testing is faster, more reliable and programmable.
The document discusses the roles and responsibilities of a project manager in software development. It covers the software development lifecycle (SDLC), common methodologies like SCRUM, and the differences between projects and products. It also describes the typical project team roles and the key duties and qualities of an effective project manager, such as planning, organizing, leading, controlling, clear communication, managing expectations, and prioritizing the team over oneself.
DevOps is a culture and practice that aims to rapidly build, test, and release software. Continuous integration requires developers to integrate code into a shared repository multiple times a day, with each check-in verified by automated builds to detect problems early. Continuous delivery is the practice of releasing every good build to users. Popular tools for continuous integration include TeamCity, Jenkins, and others.
This document provides instructions for creating a gRPC Hello World sample in C# using .NET Core. It describes creating client and server projects with protobuf definition files. The server project implements a Greeter service that returns a greeting message. The client project calls the SayHello method to get a response from the server. Running the projects demonstrates a basic gRPC communication.
The document discusses the role of a business analyst in a software project. It explains that a business analyst is involved in requirements gathering and representation. This includes eliciting requirements through preliminary discussions with customers, reviewing requirements with other roles like architects and UX designers, and specifying requirements. Requirements can be represented through user stories, use cases, documents, and other methods. User stories are written from the perspective of users and define what they want to do. Use cases outline interactions between actors and a system. Together, clearly documented requirements help ensure a project delivers business value through the right software solution.
The document discusses the role of a user experience designer, outlining their design process which includes discovering user requirements, creating design concepts and prototypes, validating designs through research and testing, and iterating on their work through collaboration and learning. It emphasizes the importance of an iterative design process driven by user needs.
Integration tests test multiple components together by using dependencies like databases, services, and APIs. They are useful for testing typical workflows and ensuring components interact smoothly but can be hard to write, maintain, and localize errors. UI tests with Selenium automate interactions with a web application like users do in order to detect errors not found by other test types, but take more time and setup compared to unit tests.
This document discusses best practices for writing clean, readable code. It covers topics like code layout, naming conventions, documentation, code smells, and code reviews. Specifically, it recommends:
- Consistent indentation and ordering for clean layout
- Meaningful naming styles like PascalCase to enhance readability
- Comments to explain difficult code or describe design decisions
- Addressing code smells like long methods or classes that could make code harder to maintain
- Conducting code reviews to improve quality and catch potential bugs
The document discusses different MV* software design patterns - MVC, MVP, and MVVM. It explains the basic structure of each pattern, including how the view, controller/presenter, and model components interact. It provides examples of each pattern, including links to sample applications. The key benefits of these patterns are also summarized, such as separation of concerns, easier testing, and independence of the UI from business logic.
This document provides an overview of best practices for Android Wear development. It discusses how to pair Wear devices, common APIs with Android, showing notifications, distributing Wear apps, defining layouts, accessing views, useful libraries like Gson and EventBus, and other tips.
The document provides an overview of communication capabilities in Android, including networking, useful networking libraries, Bluetooth, and Near Field Communication (NFC). It discusses how to connect to networks, perform network operations on a separate thread, check network connectivity, download data using HTTPURLConnection, and efficiently manage network usage. Libraries covered include Retrofit, okHTTP, Volley, and RoboSpice. The document also provides examples of discovering Bluetooth devices, connecting to Bluetooth devices, and implementing Bluetooth profiles. It concludes with a brief description of NFC technology.
The document discusses the roles and responsibilities of a project manager in software development. It covers the software development lifecycle (SDLC), common methodologies like SCRUM, and the differences between projects and products. It also describes the typical project team roles and the key duties and qualities of an effective project manager, such as planning, organizing, leading, controlling, clear communication, managing expectations, and prioritizing the team over oneself.
DevOps is a culture and practice that aims to rapidly build, test, and release software. Continuous integration requires developers to integrate code into a shared repository multiple times a day, with each check-in verified by automated builds to detect problems early. Continuous delivery is the practice of releasing every good build to users. Popular tools for continuous integration include TeamCity, Jenkins, and others.
This document provides instructions for creating a gRPC Hello World sample in C# using .NET Core. It describes creating client and server projects with protobuf definition files. The server project implements a Greeter service that returns a greeting message. The client project calls the SayHello method to get a response from the server. Running the projects demonstrates a basic gRPC communication.
The document discusses the role of a business analyst in a software project. It explains that a business analyst is involved in requirements gathering and representation. This includes eliciting requirements through preliminary discussions with customers, reviewing requirements with other roles like architects and UX designers, and specifying requirements. Requirements can be represented through user stories, use cases, documents, and other methods. User stories are written from the perspective of users and define what they want to do. Use cases outline interactions between actors and a system. Together, clearly documented requirements help ensure a project delivers business value through the right software solution.
The document discusses the role of a user experience designer, outlining their design process which includes discovering user requirements, creating design concepts and prototypes, validating designs through research and testing, and iterating on their work through collaboration and learning. It emphasizes the importance of an iterative design process driven by user needs.
Integration tests test multiple components together by using dependencies like databases, services, and APIs. They are useful for testing typical workflows and ensuring components interact smoothly but can be hard to write, maintain, and localize errors. UI tests with Selenium automate interactions with a web application like users do in order to detect errors not found by other test types, but take more time and setup compared to unit tests.
This document discusses best practices for writing clean, readable code. It covers topics like code layout, naming conventions, documentation, code smells, and code reviews. Specifically, it recommends:
- Consistent indentation and ordering for clean layout
- Meaningful naming styles like PascalCase to enhance readability
- Comments to explain difficult code or describe design decisions
- Addressing code smells like long methods or classes that could make code harder to maintain
- Conducting code reviews to improve quality and catch potential bugs
The document discusses different MV* software design patterns - MVC, MVP, and MVVM. It explains the basic structure of each pattern, including how the view, controller/presenter, and model components interact. It provides examples of each pattern, including links to sample applications. The key benefits of these patterns are also summarized, such as separation of concerns, easier testing, and independence of the UI from business logic.
This document provides an overview of best practices for Android Wear development. It discusses how to pair Wear devices, common APIs with Android, showing notifications, distributing Wear apps, defining layouts, accessing views, useful libraries like Gson and EventBus, and other tips.
The document provides an overview of communication capabilities in Android, including networking, useful networking libraries, Bluetooth, and Near Field Communication (NFC). It discusses how to connect to networks, perform network operations on a separate thread, check network connectivity, download data using HTTPURLConnection, and efficiently manage network usage. Libraries covered include Retrofit, okHTTP, Volley, and RoboSpice. The document also provides examples of discovering Bluetooth devices, connecting to Bluetooth devices, and implementing Bluetooth profiles. It concludes with a brief description of NFC technology.
The document provides an overview of Android application development fundamentals including application components, intents, manifest files, and more. It discusses that Android apps are written in Java and compiled to APK files. The core application components are activities, services, broadcast receivers, and content providers. Intents are used to start components and broadcast receivers register to receive system or app events. Every app must declare its components in the Android manifest.
The document discusses Android location and sensor APIs. It provides an overview of location services in Android, which allows apps to access location through the LocationManager. It also discusses the sensors framework, which gives access to motion, position, and environment sensors. It describes how to identify available sensors, register listeners to receive sensor events, and handle the sensor data. Key classes like SensorManager, Sensor, and SensorEventListener are also summarized.
This document provides an introduction to the Java programming language. It discusses the goals of Java, including being cross-platform, providing security through sandboxing with the Java Virtual Machine, and replacing C/C++. It explains what is needed to run and develop Java applications and the differences between Java editions. The document outlines some key differences between Java and C#/C++ and how to write a basic Java application. It also defines JAR files and provides principles for designing class structures in Java.
This document discusses documentation in software development and architecture. It provides an overview of different types of diagrams used for documentation, including structure diagrams like class and component diagrams, behavior diagrams like activity and state machine diagrams, and interaction diagrams like sequence and communication diagrams. The document also discusses challenges with documentation, including that UML can be too technical or not technical enough, as well as strategies for documentation like self-documenting code, XML documentation, and naming conventions. Finally, it presents some popular tools for documentation like Visio, Draw.io, Gliffy, and Sparx Enterprise Architect.
2. Common Table Expression
Конструкція Common Table Expression (CTE):
;with ActorsAndGenres as
(
select a.Name, g.Name as Genre
from Actor a
inner join [Cast] c on c.ActorId = a.ActorId
inner join Movie m on m.MovieId = c.MovieId
inner join Genre g on m.GenreKey = g.GenreKey
group by a.Name, g.Name
)
select Name from ActorsAndGenres
where Genre = 'Thriller'
union
select Name from ActorsAndGenres
where Genre = 'Horror'
3. Рекурсивні CTE
Генерація числової послідовності:
;with Numbers as
(
select 1 as n
union all
select n + 1
from Numbers
where n + 1 <= 10
)
select n
from Numbers
Отримання вузлів дерева:
;with pathToRoot as
(
select NodeId, ParentNodeId from Node
where NodeId = 42
union all
select n.NodeId, n.ParentNodeId from Node n
inner join pathToRoot r
on r.ParentNodeID = n.NodeID
)
select NodeId, ParentNodeId
from pathToRoot
4. Data Manipulation Language
• INSERT - вставка нового рядка або набору рядків в
таблицю БД
• UPDATE - зміна даних в таблиці БД
• DELETE - видалення рядка або набору рядків із
таблиці БД
• MERGE – всі операції над даними в одному виразі
• TRUNCATE – Очистка таблиці
5. Оператор INSERT
Вставка одного рядка з явно заданими значеннями:
insert into Actor(Name, BirthDate, SexEnum)
values (‘Jack Nickolson', ‘1937-04-25’, 1)
Використання опції DEFAULT:
CREATE TABLE Document (
…
Date datetime NOT NULL DEFAULT getdate(),
…
insert into Document (Type, Number, Client, Amount)
values (1, 'Z-001', 1, 10)
insert into Document (Type, Number, Date, Client, Amount)
values (1, 'Z-003', default, 1, 10)
insert into Document DEFAULT VALUES
6. Оператор INSERT
Вставка більше одного рядка :
insert into Document (Type, Number, Date, Client, Amount)
select 1, 'Z-010', getdate(), 1, 10
union all
select 1, 'Z-011', cast('2007-10-30' as datetime), 2, 10
insert into Document (Type, Number, Date, Client, Amount)
select Type, 'Z-012', Date, Client, Amount
from Document where Number = 'Z-003‘
insert into Actor (Name, Age, SexEnum)
values
('Jack Nicholson', '1937-04-25', 1)
,('Ralph Fiennes', '1969-03-12', 1)
,('Robert De Niro', '1943-08-01', 1)
7. Оператор INSERT
Автоінкремент (IDENTITY):
insert into Document (Type, Number, Date, Client, Amount)
select 1, 'Z-005', getdate(), 1, 10
select SCOPE_IDENTITY()
Вставка в такий стовпчик заборонена, видається повідомлення про
помилку.
Включити додавання даних до стовпців з автоінкрементом:
SET IDENTITY_INSERT Document ON/OFF
8. Оператор UPDATE
Змінює наявні дані:
update Document
set
Date = default
,Comment = NULL
where DocumentId = 1
Використання підзапитів та функцій:
update Document
set
Amount = (select sum(Amount*Price) from DocumentDetail
where Number = DocumentDetail)
,Comment = case
when Comment is null then ''
else left( Comment, 10)
end
where DocumentId = 1
9. Оператор UPDATE
Запити з кількох таблиць при зміні даних:
update doc
set Comment = 'Client - ' + Name
from Document doc
inner join Client c
on cInstance = dClient
Можна міняти дані лише в одній таблиці одночасно.
Без використання WHERE оператор UPDATE змінить всі рядки в таблиці
10. Видалення даних
Оператор DELETE:
delete from Document
where Number > 'Z'
Команда TRUNCATE:
truncate table [Cast]
Відмінності використання TRUNCATE та DELETE :
Не логується видалення окремих рядків таблиці, записуються лише відомості
про звільнений простір
Не обробляються трігери та, як наслідок, посилання на зовнішні ключі
Значення автогенератора (IDENTITY) змінюється на початкове
Потрібно мати доступ до таблиці як власник
Як і у випадку з UPDATE:
не забувайте WHERE =)
11. Оператор MERGE
Вся логіка роботи з таблицею в одному операторі:
;merge into dbo.LayerBuffer as target
using @LayerBuffers as source
on (target.LayerBufferId = source.LayerBufferId)
when matched then
update set target.Argb = source.Argb
when not matched by source and (target.LayerId = @LayerId) then
delete
when not matched by target then
insert (LayerId, BufferMeters, Shape)
values (
@LayerId
,source.BufferMeters
,source.Shape)
);
12. Оператор OUTPUT
Вивід змінених значень:
insert into Movie
(Name, Description, PremiereDate, BoxOffice, GenreKey)
output inserted.MovieId, inserted.Name
values
('Pulp Fiction', null, '1994-02-22', 21349700, 7)
,('The Shining', null, '1980-05-23', 30000400, 13)
update [Cast]
set CharacterName = ‘Willy Wonka’
output inserted.CharacterName into #tempTable
where CharacterName = ‘WalterWhite’
delete from Feedback
output deleted.FeedbackId into DeletedId(Id)
where Rank < 5
13. OUTPUT та MERGE
;with newActor as (
select 'Natalie Portman' Name
union select 'Jack Nicholson'
union select 'Tom Hanks'
)
merge into Actor as target
using newActor as source
on (target.Name = source.Name)
when matched then
update set BirthDate = ‘1753-01-01'
when not matched by source then
delete
when not matched by target then
insert (Name, BirthDate, SexEnum)
values(source.Name, source.BirthDate, source.SexEnum)
output $action, inserted.ActorId, inserted.Name, deleted.ActorId,
deleted.Name;
14. OUTPUT та MERGE
Мапінг значень з різних таблиць:
merge into dbo.[Event] using @Events as e on 1 = 0
when not matched then
insert
(
Name,
Description
)
values
(
Name,
Description
)
output e.FakeEventId, inserted.EventId
into RealAndFakeIds (fakeId, realId);
15. Представлення View
Створення представлень:
create view DocumentView as
select d.DocumentId, d.Name, t.Type, d.Number, d.Date, d.Amount
from Document d
inner join Client c on c.ClientId = d.ClientId
inner join DocumentType t on t.DocumentTypeId = d.DocumentTypeId
При створенні представлень можна вказати додаткові опції, наприклад, WITH CHECK OPTION чи
WITH ENCRYPTION, інші.
Використання представлень:
select * from DocumentView
DocumentId Name Type Number Date Amount
--------- --------- ------- ------- ---------- -------
1 Client_1 Invoice I-001 2007-10-31 0.00
2 Client_2 Invoice I-002 2007-01-04 35.00
3 Client_1 Invoice I-003 2007-02-04 10.00
4 Client_1 Invoice I-004 2007-02-04 20.00
16. Зміна даних за допомогою представлень:
INSERT INTO DocumentView(Name) VALUES ('AAA')
update DocumentView
set Date = cast(convert(varchar(10), Date, 102) as datetime)
Дані в представленнях можна змінювати прямо вказані поля із
таблиць за допомогою операторів INSERT, UPDATE, DELETE лише в
одній табличці одночасно та при виконанні наступних умов :
― відсутність агрегатних функцій та виразу GROUP BY
― не можна використовувати CROSS JOIN
― відсутність виразів TOP, DISTINCT чи UNION
― не можна використовувати колонки, які обраховуються всередині
представлення
Представлення View