Skip to content

Conversation

@ardalis
Copy link
Contributor

@ardalis ardalis commented Apr 9, 2018

READY TO MERGE

This is a PR with the 2.1 updates to the eShopOnWeb eBook.

@mairaw mairaw closed this Apr 9, 2018
@mairaw mairaw reopened this Apr 9, 2018
@mairaw mairaw added the WIP label Apr 10, 2018
ardalis added 3 commits May 29, 2018 12:20
Migrating content from microservices book
Cleaning up some formatting.
Also fixing formatting and a couple of content errors.
Updating functional testing with 2.1 approach
@ardalis ardalis changed the title eBook 2.1 Updates (WIP) eBook 2.1 Updates May 31, 2018
@ardalis
Copy link
Contributor Author

ardalis commented May 31, 2018

Ready for review @CESARDELATORRE

@CESARDELATORRE
Copy link
Contributor

Maira, can you review/merge this PR when possible?
Thanks,

@mairaw mairaw removed the WIP label Jun 7, 2018
@mairaw
Copy link
Contributor

mairaw commented Jun 7, 2018

Sure! I missed @ardalis last comment here. I'm working on your PR now.

@mairaw
Copy link
Contributor

mairaw commented Jun 7, 2018

WIP is still on here. Let me close and reopen to see if it helps.

@mairaw mairaw closed this Jun 7, 2018
@mairaw mairaw reopened this Jun 7, 2018
@mairaw mairaw changed the title eBook 2.1 Updates eBook 2.1 updates Jun 7, 2018
@mairaw mairaw changed the title eBook 2.1 updates WIP eBook 2.1 updates Jun 7, 2018
@mairaw mairaw changed the title WIP eBook 2.1 updates eBook 2.1 updates Jun 7, 2018
@mairaw
Copy link
Contributor

mairaw commented Jun 7, 2018

Interesting. WIP bot is stuck. Have you ever seen this happen @terrajobst?

@ardalis I'll start the review now but please check the warnings from the last build report as well.

@BillWagner
Copy link
Member

Interesting. WIP bot is stuck. Have you ever seen this happen @terrajobst?

I saw this once before when one of the earlier commit messages had "WIP" in the message. I think a squash (or other interactive rebase) to edit the commit message would fix it. Also, if that's the root cause, we should file a bug with that bot.

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ardalis. It looks good overall but I didn't get through it all yet. But I wanted to give you some feedback already. I also sent you an e-mail - please check.

description: .NET Microservices Architecture for Containerized .NET Applications | Designing the infrastructure persistence layer
author: CESARDELATORRE
ms.author: wiwagn
ms.date: 11/08/2017
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update ms.date

The Specification pattern (its full name would be Query-specification pattern) is a Domain-Driven Design pattern designed as the place where you can put the definition of a query with optional sorting and paging logic.

The Specification pattern defines a query in an object. For example, in order to encapsulate a paged query that searches for some products, you can create a PagedProduct specification that takes the necessary input parameters (pageNumber, pageSize, filter, etc.). Then, within any Repository method (usually a List() overload) it would accept an ISpecification and run the expected query based on that specification.
The Specification pattern defines a query in an object. For example, in order to encapsulate a paged query that searches for some products, you can create a PagedProduct specification that takes the necessary input parameters (pageNumber, pageSize, filter, etc.). Then, within any Repository method (usually a List() overload) it would accept an `ISpecification` and run the expected query based on that specification.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need specification uppercase here (e.g. https://en.wikipedia.org/wiki/Specification_pattern - ignore the URL, look at the content 😄)

// https://github.com/dotnet-architecture/eShopOnWeb
public interface ISpecification<T>
{
Expression<Func<T, bool>> Criteria { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 122, you haven't updated that EF Core 2.1 as well?

[http://deviq.com/repository-pattern/](http://deviq.com/repository-pattern/)

* **Edward Hieatt and Rob Mee. Repository pattern.**
[_http://martinfowler.com/eaaCatalog/repository.html_](http://martinfowler.com/eaaCatalog/repository.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use https link


# Designing the infrastructure persistence layer

Data persistence components provide access to the data hosted within the boundaries of a microservice (that is, a microservice’s database). They contain the actual implementation of components such as repositories and [Unit of Work](https://martinfowler.com/eaaCatalog/unitOfWork.html) classes, like custom EF DBContexts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add alt text to the images - it's something that wasn't done earlier and is important for accessibility

line 23 - last sentence is hard to read. Can you improve that?

line 47 - GitHub struggles to show formatting with incomplete code so it's hard to spot after that code block if something is using the wrong formatting or not. Can you add ... and closing braces so we can see the content better while diffing?

![](./media/image5-13.png)

You can include multiple components/libraries or internal layers within each container, as illustrated in Figure 5-X. But, following the container principal of *"a container does one thing, and does it in one process*", the monolithic pattern might be a conflict.
You can include multiple components/libraries or internal layers within each container, as illustrated in Figure 5-X. But, following the container principal of _"a container does one thing, and does it in one process_", the monolithic pattern might be a conflict.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mention several times figure 5-X but there doesn't seem to be such figure

> - Interfaces
> - Services
> - DTOs
>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any special reason to add these lists inside quotation marks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, someone converted my Word doc to Markdown and did that.

This guide provides end-to-end guidance on building monolithic web applications using ASP.NET Core and Azure.

This guide is complementary to the "*Architecting and Developing Containerized and Microservice-based Applications with .NET*" which focuses more on Docker, Microservices, and Deployment of Containers to host enterprise applications.
This guide is complementary to the "_Architecting and Developing Containerized and Microservice-based Applications with .NET_" which focuses more on Docker, Microservices, and Deployment of Containers to host enterprise applications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add link to that book here? the one on docs I mean

You should name your tests in a consistent fashion, with names that indicate what each test does. One approach I've had great success with is to name test classes according to the class and method they are testing. This results in many small test classes, but it makes it extremely clear what each test is responsible for. With the test class name set up to identify the class and method to be tested, the test method name can be used to specify the behavior being tested. This should include the expected behavior and any inputs or assumptions that should yield this behavior. Some example test names:

- CatalogControllerGetImage.CallsImageServiceWithId
* CatalogControllerGetImage.CallsImageServiceWithId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codefence these

> \_- Anonymous-
## Summary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 36... same issue here with incomplete code samples

@terrajobst
Copy link
Contributor

Interesting. WIP bot is stuck. Have you ever seen this happen @terrajobst?

AFAIK the WIP bot also looks at commit messages. There is still one commit that includes "WIP" in it. Try to reword that commit.

@terrajobst
Copy link
Contributor

I saw this once before when one of the earlier commit messages had "WIP" in the message. I think a squash (or other interactive rebase) to edit the commit message would fix it. Also, if that's the root cause, we should file a bug with that bot.

It's currently by-design but it's discussed here.

@ardalis
Copy link
Contributor Author

ardalis commented Jun 8, 2018

Read that thread - seems odd that some ancient commit that happened to be WIP will then make the entire PR forever be considered WIP. That's not a great design. Having to rewrite history on older commits like that is someone nerve-wracking, too. I can do it if it that's what's required here, though. Please confirm that's what I should do and (if you have some) point me to known good instructions for doing so. I think this is the (only) offending commit:
d227706

@BillWagner
Copy link
Member

@ardalis this is a good resource for squash and rebase.

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more comments after my quick fixes via GH UI

Thisll probably be my biggest feedback. Im really not a fan of repositories, mainly because they hide the important details of the underlying persistence mechanism. Its why I go for MediatR for commands, too. I can use the full power of the persistence layer, and push all that domain behavior into my aggregate roots. I dont usually want to mock my repositoriesI still need to have that integration test with the real thing. Going CQRS meant that we didnt really have a need for repositories any more.

We find repositories useful, but we acknowledge that they are not critical for your DDD, in the way that the Aggregate pattern and rich domain model are. Therefore, use the Repository pattern or not, as you see fit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks! So I'll change to not use we then.

> - Services
> - DTOs
### Application Core types

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add some introductory sentences before each list?

}
```

Routes can be specified on [HttpGet] and similar attributes, avoiding the need to add separate [Route\] attributes. Attribute routes can also use tokens to reduce the need to repeat controller or action names, as shown below:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 46 - should that \ really be there?


In addition to serving pages and responding to requests for data via web APIs, ASP.NET Core apps can communicate directly with connected clients. This outbound communication can use a variety of transport technologies, the most common being WebSockets. ASP.NET Core SignalR is a library that makes it simple to add real-time server-to-client communication functionality to your applications. SignalR supports a variety of transport technologies, including WebSockets, and abstracts away many of the implementation details from the developer.

ASP.NET Core SignalR is currently under development, and will be available in the next release of ASP.NET Core. However, other [open source WebSockets libraries](https://github.com/radu-matei/websocket-manager) are currently available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not up-to-date given the SignalR release in 2.1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

---
title: Choose between traditional web apps and single page apps
description: Architect modern web applications with ASP.NET Core and Microsoft Azure
description: Architect Modern Web Applications with ASP.NET Core and Azure | Choose Between Traditional Web App or SPA
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one sentence, don't include the name of the book

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

- Advanced diagnostics

*Learn more about Azure deployment options in Chapter 10.*
_Learn more about Azure deployment options in Chapter 10._
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add link?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mairaw
Copy link
Contributor

mairaw commented Jun 28, 2018

@ardalis I've left a few last comments but it's looking good. Take a look at my comments and questions from earlier today and just now.

@ardalis
Copy link
Contributor Author

ardalis commented Jun 29, 2018

All good. :shipit:

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a few things here and there that I'd like to see addressed overall in these e-books to help with SEO (description should be modified for all articles, image file names should be friendly) and accessibility (all images should have alt text) but I'm going to approve this one. Thanks for your work on this. It looks great!

Should we publish ASAP or do you have a specific day in mind of when the update should be published?

@ardalis
Copy link
Contributor Author

ardalis commented Jun 29, 2018

I'm fine to publish immediately. Maybe check with @CESARDELATORRE

@mairaw mairaw merged commit fcb96dd into dotnet:master Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants