|
|
26/11/2007 Today had to spend a bit time on client side code for FireFox. Since I'm coming from IE development only, the whole thing was not so pleasant (plus the fact that either IE sins too much or FF is not really a saint, probably both). So I ended up with 2 things that literally saved my time - Prototype JavaScript framework and Firebug addon for FF. Great to things that just made my day.... Read full article 22/11/2007 Editing the project file and adding this section will ensure the MbUnit tests are executed on successful builds. <PropertyGroup> <PostBuildEvent>"$(ProjectDir)<location in the project>\MbUnit.Cons.exe" "$(TargetPath)" /sr /rt:text</PostBuildEvent>...
Read full article I am not making any news by saying what was said before - R# folks were surprised as much as we were by so early release of VS.NET 2008. I wonder what was the reason to this early release and how soon as a result of that we will be rushing to download SP1 for it... The point is not that. What I would suggest is do not run R# in VS.NET 2008 without proper support on R# side. Wait a bit, it will come. I am saying so because coding in VS.NET 2008 without fully capable R# running is PAIN... ... Read full article 15/11/2007 The adding is free and allows to work with SVN from the VS.NET (from the context menu). If your preference is not to leave the IDE and you want visual indication of the file status, AnkhSVN is the one you should check out.... Read full article 10/11/2007 The final day. People are tired and some 'deliverables' are slightly trimmed, but we are heading towards the target. My personal target was to wrap around the idea of agile and TDD. I defiantly do not consider myself as a person that understands exactly all the details, but I definitely see the difference and know towards what I should be heading. ... Read full article 09/11/2007 'Almost' productive day - seeing how it works in reality is hilarious. TDD is not only allows testability, but also to design better your code with regards to not 'what if', but 'what now'. Really powerful tool that would be great to have in my skills set. Script of the day: 10:00 Domain Model (Rich Domain) - Domain object is more than just properties, it's also behavior - 14 AA Points - URL will be coming later -> jpboodhoo.com -> search for "Getting Started Learning Some new Developer Habits" - R# -> Autocompletion -> Letters and Digits - DynamicMock<T> vs. CreateMock<T> (dynamic will always provide the default value when "created" mock has to be told everything) 11:15 Domain Driven Design - Thin service layer & Transaction Script () patterns - Use R#, don't accept naked Visual studio - naked it's really ugly. - TestDriven.Net - [Setup] is for the hard dependencies of the SUT (ie DynamicMock<T>) - Book: xUnit Testing Patterns - Department / Products: DB relationship is one to many, Domain Model is one to one (ie not Department.GetAllProducts(departmentId), but Catalog.GetAllProductsBelongingTo(departmentObject) ) 14:15 - Service Layer - interaction test can later involve into integration testing - REQUIREMENT: Important to understand the RhinoMock in order to use it and learn TDD - R# CTRL-Shift-E parse the exception from clipboard - Hard dependencies should be be dynamic ones and defines for the whole test class 16:10 Container - Principles that container helps to respect: DIP, OCP - Container (our) should be a static gateway that also an adapter to allow with variety of different containers - Concrete dependencies should be removed by using container to decouple from concrete implementation - pair-programming / TDD ping-pong 23:50 - JP is SO tired that reads for a minute a result of breaking test :) - Building rich domain model = building smarts with objects (example: ShoppihgCart with CartItem through Factory) 00:50 Toasted... 08/11/2007 They say "The more you know the less you have to say". Almost, my version is "The more you know the more you want to scream". Why scream? Because you realize each time how much more you don't know. Well, it's a healthy process besides the fact that from a side it looks like a total mental disorder... No comments. Day 3 notes: 09:00 - State testing initially only might be better that trying to apply both testing strategies (state and interaction) - Developing Top-Down, not the Domain Model First - Layers (horizontal, top down): UI, Presentation layer, Service layer, Domain/ORM - Layers (vertical): Security, Logging, Utility - UI pieces and stories - DTOs and Domain Model are not pointing anything else (presentation, ORM, service, UI layers) - DTOs allowing domain model and UI to be independent (UI does not dictate what model will be) - Service layer is a (Application) Gateway and Facade - Application startup is happening in Service layer [Note:] Friday (9/11/2007) how to combine domain model business rules validations with client side - Service layer should log exceptions - Most of exceptions are in the mapping layer (DB constraints violations, timeouts, etc) and domain logic (business rules violation) - The only time to catch an exception is to put the system in stable mode, otherwise let it go and show that a system has a bug that has to be fixed - Auditing = Decorating the ORM components! 10:00 Story Document and Story Cards - Story cards are 'like' use cases, story document is a bit more detailed - Stories are one page long at most and dedicated to the users and products through out the life of the project - Stories are ALWAYS coming from the business users with a DEFINED/UNIFIES domain language - purpose of story card is to shortly and precisely describe 3 things: WHO / WHAT / WHY - you need to have the story card and a strong access to the user (story teller) to supply the details , where strong access to the domain specialist is phone or one on one - BA would flush out more out of the story card - Story Document + Story Cards + UI prototype mock (what user NEEDS not WANTS) = deliverable for the iteration that both devs and client sigh off (for the iteration 0) - Story will disclose many of domain objects (nouns in the domain language) (highlight them when writing) "Days of head-down developers are done!" - Remind the customer of time impacts on deliverable when adding to the story - let the customer to decide if they want a feature or a down scale of the feature based on what they need and what they want to invest into it - Assumptions are evil, especially with clients - Front load iterations planning meetings - Story card summarizes what story document says in form of who/what/why scoop: next year there will be an agile PM course. 10:45 UI layer - Build box doesn't have IDE on it - keep 3rd party assemblies in solution so you don't have to configure the environment to stat building (build) process - Repeater is better than Grid, Alternate template is lame (?later) - avoid postback as much as possible working with the plain html where possible 11:08 Presentation - Tests First - Pait Programming - presenter roles: decouple view from model and route messages - Interfaces are not serializable, therefor POCO DTOs are the way to go - If a name (of a class or interface) does not disclose the meaning and usage, rename it - To mock a DTO that cant be instantiated - mark all as virtual - R# CTRL-ALT-Space - Pair programming - one is building the test, another one is implementing - Reading a test in plain English goes bottom to top, from SUT to record stage - Test names should present what they really do. Example why: to create a list for QA for testing, reflectively processing the list of test methods - Concrete dependencies for tests are initialized in SetUp() and defined as memeber fields [Note: not switching to Mac!] - NULLs are evil - avoid passing NULLs around - Don't only write the test, also try to read it in plain English putting yourself the SUT perspective (as you were the SUT) - Interface = contract/blueprint/contract - Debugging tests smells bad! Q: JP, who is Richard Hurse? - WatiN project for UI browser-in testing - Interaction tests should be understood how to read in plain language and not as a pure code 13:40 Linking UI and Presenter - JP will build his whole site as an MVC project with MS MVC as an open source Q: How to use DotTracer? - .ASPX / .ASCX is a Template View patterns (classic asp was the same, but no support for separation of concerns) - Let the view engine be responsible for rendering the template Q: A page that requires more than one task/service AND how to not to couple between them but have cooperating with each other (event aggregator?) - Spend 20 minutes on method visibility and 40 on customer feature to be implemented, and not vice versa - A view without traces of Presenter --> presenter is actualy a Mediator pattern implementer - For presenter, Task/service is not in place, so what we do is we create a private internal stub task/service class to fulfil presenter requirements and to be able to sign off. Stub class for servise/task will be eliminated asap. - valueType.ToString("bla bla 0") - no need in curly brackets - DTO allows Separation of concerns and SRP principles - a change in a DTO is not forcing a change in view nor presenter - In an agile team the DBA has to take part in agile development and devs and DBA cooperate and resolve problems together [Sean] Compilation should not be indication of syntax error. It should be an indication of bad design. - ITransformer - a compositional solution to do the fluent interface (ie to perform the conversion of type) - .NET 3.5 will allow fluent interface implementation with extension methods (example: Container.DataItem.To<Abc>.Prop) 19:30 - Passive view - communication between view and presenter is done with events (enforces chattiness in both ways) - >>>Supervising controller - logic pushed to the presenter (controller), ui related stuff stay in the view - ASP.NET is a more complex abstraction of things that were less complex in the beginning - Presentation model - J. Miller "The most important 'ility' is maintainability". - You have to bring the lowest common level developer to the level to understand agile and TDD or it wont work at all - Dispair.com 21:40 - Building network - linking between blogs and sources 22:30 - Submitting data from the view to presenter - R# CTRL-Shift-E - show stack tree for the exception text in the clipboard 23:10 - Duplicate code smells, including in tests - strive to eliminate it completly 23:30 - Design by Contract - Pushing data from UI to Presenter - presenter is available for the view - keep a reference to it - Exploring the beauty of discovering controls in a templated container in .NET - not a simple task at 00:11. Nope. - Done exploring (00:16) Personal conclusion: no place for political correctness in a team, not in agile team for sure. - 5 minute break 00:30 - Refactoring Patterns 01:01 - Lost it... "What are we talking about?" - Chicken Little - Mapper on Repeater Item - "What if" vs. "now what" concept; what if == premature generalization 01:17 EOM. Hibernating... 05:30 Hibernation failed. System is shutting down for 3 hours of sleep. (Talks about various subjects) PS: I am so glad I got on this train, and met all the interesting people. I hope to ride this train for as long and as far as my capacities will allow me. 07/11/2007 The second day was as good as the first, with a tiny exception for configuration of CruiseControl.NET - IMO, technique is valuable, not the technical details. Specification technique was bright, logging exercise was a healthy one. Learned to differentiate between state testing and interaction testing, but I am not completely set on it. Here are the notes taken through out the day 2: 09:00 - http://codekata.pragprog.com - Build process and not compilation in vs.net: speed; logging; testing; - Spike new stuff, do not have a deep understanding, until you have to have it in your project - "Use the tool knowing you can produce the same result without the tool." - J. Nielson - "Speaking and writting is not an elite club - be honest and be good in what you do." - JP - Plan success for yourself for a short/long periods of time. - It doesn't matter what you do as you do it the best. - IEnumerable<T> is a gateway to get an Iterator<T> 10:00 - "Introduce Local Extension" refactoring technique - exampe: IRichList and RichList - Refactoring book - re-read - Decorator has exactly the same interface as the object it decorates (intent: add functionality without changing the public interface) - Client - dont care about what Decorator does. With "Local Extension" you care about implementation - Extension methods in .Net 3.5 will introduce a form of a code reuse that can quickly become a code abuse - IComparer<T> --> Strategy implementation for comparng in .Net - R# CTRL-N *Pub will find all classes with "Pub" in it - one ONE 1 return per method - old and good school 11:00 - Proxy = secured composing mechanism - Use the best tools for the right tasks (me:) - Aggregate - boundry of protection (library and it's books) - Composite - complex structure - the root and the leaf are of the same interface and the difference is that some operations on leafs might not do what the do on root or opposite (with Iterators and Visitors, with Command) - Think Domain Driven, not Data Driven 11:30 Querying [Q] How to do TDD with WebControls? - function that return function -> return a new delegate 11:50 Specifications // TODO: implement ISpecification for IEntityCollection - Specifications create a tree of objects, that can be translated into a query for DB or any other repository - LINQ: abstruction the details of how the provider takes the expression and converts into query scoop: "Nothing But *" sessions will be coming soon with different well known people 13:25 - FW harvesting: design solution for the client and pull out pieces for the FW to be reused - FW should be harvested from the real life projects and not built in isolation 14:00 DB - Developers should have local DB to speed development and not to delay the rest of the team while testing/developing - File Unlocker - http://ccollomb.free.fr/unlocker/ - Windows Task Switcher - http://ccollomb.free.fr/unlocker/ - MyUninstaller utility - keyboard friendly - Console - tabbed console - QueryExpress - sql server management studio alternative A joke that CJ told: "I had a problem i wanted to solve with regex. Now I have 2 problems to solve." 15:37 Continuous Integration (WebApp) - Test has A)Unit (test) B)Integration (test) - Aspect# (Castle, AOP) 15:50 Mocked Testing - Mocked testing is an interaction testing - RhinoMocks framework - using (mockery.Record()){} - using (mockery.Playback()){} 17:30 Testing - State Base vs. Interaction Based (mocked) testing - Component partitioning - separating interfaces from implementors for separate packaging - examples: Log class is a static gateway 19:00 CruiseControl.NET - a front controller implementation that allows dashboard configuration through xsl files - CI = Compilation, Unit testing, Code Coverage, FxCop, Versioning, Reporting, Publishing - a role of a build-manager cycles through the iteration to spread the knowledge and know how to do that - development cycle should be short (around 15 minutes) so when you commit the changes the amount of collisions when merging would be minimal 21:45 --- END OF ITERATION 0 --- 22:30 EOM 06/11/2007 There's a project "A notebook per child". I think we should extend that also to "A R# licence per developer". While talking to JP, I have mentioned that everyone needs to have once in a while what I call a 'motivation injection'. Being a software developer, this 'injection' means a lot. It gives you the drive to lift yourself to the next level by just realizing there's a next level. So when the last time you had you shot? :)... Read full article I had/will not have time over the week of the training course to sort out all the notes I am taking while participating at the session. Saying that, I want to make it clear that these are uncensored thoughts of mine at a crazy pace of the course with tones of new material flying around between 0800 and 2400 (with a few little breaks in between). One more thing I had to mention - feeling like a fish in water is a great feeling. What I'm down to is that finally it feels good to be around smart and intelligent people that are striving to get the knowledge as much as you are if not even more. So the notes from day 01 (text format, typed in Notepad2): 0830 - slickrun to speed up things (there's something for mac OS as well) - no mouse - do not rely on debugger.. rely on logs and tests [v] get the plan for the week from JP - web dev. is a lot context switching (JS, CSS, Markup, etc) JP IP 192.168.100.15 - criticize everything and actively question it - books: head first design patterns; head first A & D; applying UML and patterns; clr via c#; Code complete; Pragmatic programmer(!!!); DDD - tackling complexity by Eril Evans; Working effectively with legacy code; Agile principles, patterns and designs in C#; Core J2EE patterns; NHibernate in Action (!); xUnit testing pattern (!); Roy Osherovs book; - Boodhoo Listmania!; - MIT open courseware (==> change; real oop; 6months;) - JPs wishlist at Amazon - Subversion software (teams up to 1k) [xxxxxx - r# lisence or amazon?] [bring pain killers...] - svn scheme : UMATC = Update Merge Add Test Commit - 1st project: C:\Development\Course\labexercises\SeanF\product\test\xunit - wow [bring more pain killers...] - TestDriven.Net -> the investment is worth (?! James Kovacs = JC) - Visual SVN --> SVN for vs.net CTRL-Shift-A --> add a new item in vs.net - coding standards doc should not be long - what should matter is how to solve problems and raise the quality of code CTRL-minus --> run macro to rename test method ALT-R-N-I (R# new interface) CTRL-Space (auto completion) CTRL-Shift-space (smart auto completion) - Logical assertion - keep assertions low - MbUnit can do parameterized test methods (combined with attributes Row and RowTest) - unit test should not change the state of the system - each test is a 'clean slate' (JP) - SRP principle - logic and assertions (parameters checks) should not be mixed -> pull out into assertion class (SRP) 1245-1330 lunch - R# has a NAnt support - Final Builder - a commercial tool for deployment to abstract complexity - "files excluded from compilation" - dangerous - requires visual judgment from a developer - potentially bugs - http://nant.sourceforge.net - Tasks are executable units - http://www.visualsvn.com/ - SVN can point at external repository (like HTTP) - book: Pragmatic Subversion (for SVN) - R# CTRL-Shift-N (search filenames) - <property name="xunit.console.args" value="${labExercises.output} /sr /rt:Text" /> <!--show report; report type--> 1515 Events/Delegates - R# CTRL-ALT-Space (all matching classes to partially typed name) - Test should contain the behavior - ie if i test the click, don't create an event handler, but an anonymous delegate - Anonymous delegates should strive to 1-line only - private EventHandler<BreakDownEventArgs> _handler; ==> private EventHandler<BreakDownEventArgs> _handler = delegate{}; // NON empty handler - EventHandler<EventArgs<MyDto>> where EventArgs<T> is a custom generic class along with the MyDto class - EventHandlerList (CLS class) with AddHandler and RemoveHandler - Implicit interface implementation --> have to cast to the interface explicitly - ISSUE: .Net events are introducing coupling... 1645 - microsoft.msdn.ca/ignite -->JC on tools - scoop: R# will have its own solution explorer - enums are bad for internalization => replace by Value Object pattern (class) - SUT (System/subject under testing) never has a member field 1730 - Const is published with the using code, and not the class - Subscriber & Publisher attributes are published in a seporate assembly (interface assembly) and given to the 3rd party ==> Q: how to load plugging with asp.net??? A: observer - R# -> LOOP snippet for for statement - IEnumerable<T> --> grand parent of all collections (typed) - "Tell Dont Ask" principle (collection.Property.Count vs. collection.IsEmpty) 2130 [Need pain killer... NOW!] - Compiles != No errors => to resolve TDD & CI - Structs impose design limitations - Termin: "Necessary Evil" - ReferenceEquals() method - very fast - method length != number of responsibilities 2215 ==> Q: issues with method chaining (case when int, int passed into double, double with returned type string... A: use classes and not static utility methods, separate concerns - R# --> when implementing interface, can DELEGATE to parameter passed in to do automated forwarding - Decorator forwards to decorated object then adds functionality / Proxy can choose if to do the forwarding or not 2250 - Suffixing with Pattern name should only be on Factories - IEqualityComparer<T> + Decorator from an IList to IRichList - decorator for comparer - Comparison<T> ==> adaptor pattern 2400 (EOM) 04/11/2007 Download it here. PS: Am I missing something, but the ASP.NET part seems to be incomplete... 02/11/2007 JP has instructed the group to make certain things before the training course will start. So what is required to do the job? - Visual Studio .NET 2005 Professional
- SQL Server 2005 Developer Edition /SQL Server Express
- ReSharper 3
- TortoiseSVN
TDD should cover things like: - Continuous Integration with NAnt and CruiseControl .Net
- xUnit framework --> MbUnit
I am looking towards a very productive work. Things that according to JP "have made sneak appearances" in previous training (and I hope we get there): - Log4Net
- Castle Windsor
- Castle Monorail
- NHibernate
|