The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jameswiseman (13) [Avatar] Offline
#1
Really loving this, by the way. Looking forward to the rest of the book.

I've jotted a few thoughts and ideas down. I originally thought about putting them each in separate threads, but decided against it:

General points/queries:
(1) I notice you reference Visual 2010 as the tool. Although a great tool do you maybe want to consider 2012 instead, given that 2010 will be 3 years old at the time of publication
(2) Do you really want to promote a console app to test your project? I realise that this is a quick and easy way of doing this, but I wonder if using test project would be a favourable alternative, as it promotes the practice of unit testing. Also, not only would you be demonstrating the complexity of the code, but the complexity of each unit test required to support it. You could still include your treasured “leave as an exercise for the reader” comment by saying that the creation of additional unit tests would be just that smilie

Personally, I now force myself to use a Test Project to test even simple sandbox/experimental projects just so I get in the habit of doing so.

I realise that this means that you have to bias one of the frameworks, and may place an onus on the reader to download the supporting components (although if its MSTest, then event Visual Studio 2012 express edition has support for it: http://blogs.msdn.com/b/visualstudioalm/archive/2012/03/13/what-s-new-for-mstest-unit-tests-in-visual-studio-11-beta.aspx). I would say that almost everyone interesting about AOP will have sympathy for unit testing frameworks).

(3) Mark Seemann references a “Poor Man’s DI” in this “DI in .NET” book. Is there a “Poor-Man’s AOP” equivalent? Is worth mentioning.
(4) Some of the gaps between the lines (lines spacing) in the code blocks seem inconsistent. Consider the block on page 40 where there are 3 consecutive Console.Writeline that have different spacing.


I've also spotted a few typos/corrections. Reading other posts it seems to be that a lot of these will be scooped up in the formal review, but figured there was no harm in highlighting the:

Page 32 – “I highly encourage” -> “I would highly encourage”
Page 32 – “but you’ve dealth” -> “but you’ve dealt”
Page 34 – Given the space constraints inherent, have you considered using the shortened enum syntax:
public enum Size
{
Compact = 0, Midsize, FullSize, Luxury, Truck, SUV
}
Page 35 – For me, this para does not scan well. I understand it as something like the following. Is this correct?
“With that out of the way, let’s go back and look at the ILoyaltyAccrualService ‘Accrue’ method . This will interact with the entities that other Acme software modules send our way.
Page 35 – Where is ILoyaltyDataService? You define the interfaces for Accrual and Redemption , but not this one. Is it an expected external one? If so, maybe should allude to this, or otherwise, include the interface
Page 35 – “whenn” -> “when”
Page 35 – I wonder as to the merits of bundling this class in with the main class. Does it not sit better with the console app, or some other project that implements all the project fakes.
Page 38/39 – ‘7’ is straddled across pages
Page 39 – “justRe to be” -> “just to be”
Page 44 – 'scope.Complete' should be fixed-font.
Page 53/54 – ‘5’ is straddled across pages
matthew.groves (46) [Avatar] Offline
#2
Re: Thoughts and comments on Chapter 2
James,

Thanks for the feedback. Here are some comments:

1) Visual Studio 2010 - As far as I know, nothing I'm doing in 2010 is different in 2012. This might be something to consider so the book doesn't appear dated, but not everyone is always using the latest tool. Maybe just a mention early on that both 2010 and 2012 should work. I think even 2008 should work. (And for non-PostSharp examples, I think even 2005 and earlier versions will still work, though without NuGet it's more complicated).

2) There's a whole chapter on unit testing that doesn't appear on the MEAP page Table of Contents (yet). It's very encouraging that you are thinking in tests!

3) "Poor man's AOP", in my view, is the proxy/decorator pattern, though that's a little unfair because proxy/decorator can be used for more than just cross-cutting concerns.

4) I'm not seeing this spacing issue...are you reading the PDF version?

Thanks,

Matt
jameswiseman (13) [Avatar] Offline
#3
Re: Thoughts and comments on Chapter 2
Thanks.

Just to follow up on the VS2010 point, really it was obselescence that I was most referring to.

You make a good point about Visual Studio versions, although I'm not sure the same is true for the free versions of the tool (which you do reference this in the book).Given that you allude to the capabilities of the free version of PostSharp, it might be good to assume the read might be using the free version of VS as well. My understanding is that the 2012 Express version is the first to support NuGet:

http://blogs.msdn.com/b/visualstudio/archive/2012/09/12/visual-studio-express-2012-for-windows-desktop-is-here.aspx

http://msdn.microsoft.com/en-us/library/ms349441.aspx
matthew.groves (46) [Avatar] Offline
#4
Re: Thoughts and comments on Chapter 2
Ah, a very good point! I know PostSharp will work with VS2010 express...

...it does look like NuGet works with Visual Studio Express, but I need to try it out to be sure: http://stackoverflow.com/questions/4566908/how-can-i-use-nuget-with-visual-c-sharp-express

In any case, I definitely need to add some information up front about Visual Studio, Visual Studio Express, 2010, and 2012, and NuGet.
jameswiseman (13) [Avatar] Offline
#5
Re: Thoughts and comments on Chapter 2
Cool.

It case its of any relevance to you, I also had a bit of hassle with installing PostSharp with Nuget, as PostSharp wants a later version of Nuget that the 1.6 that I had. I'm assuming older versions of the IDEs may have an older version of NuGet, And it didn't have much success in updating itself!!
matthew.groves (46) [Avatar] Offline
#6
Re: Thoughts and comments on Chapter 2
Ah yes, some NuGet upgrades have been a pain. You might try:

1) Run VS as admin
2) Uninstall old version of NuGet
3) Close VS
4) Run VS as admin
5) Install new version of NuGet via Extension Gallery

I've had to do that a couple times when I wasn't using the latest NuGet, depending on how I first installed it.
akim.boyko (5) [Avatar] Offline
#7
Re: Thoughts and comments on Chapter 2
>> (3) Mark Seemann references a “Poor Man’s DI” in this “DI in .NET” book. Is there a “Poor-Man’s AOP” equivalent? Is worth mentioning.

I also found "Poor-Man’s AOP" example to be useful while describing AOP to people without any previous expirience of AOP. There are bunch of adoptions of AOP approach in different non-AOP frameworks: NHibernate has a lazy-loading, Dependency Injection containers with interception's extensions (see Seemann book), Action Filters ASP.Net MVC and Code Contracts (see details http://programmers.stackexchange.com/q/181963/49383). Any of them could be starting point for "Poor-Man’s AOP" example.