Saturday 22 December 2012

Add Tag with folder and file names

TagScanner

Go to tab "TAG Processor" and select "Generate TAG from filename" from the Action group (2nd icon) on the tool bar

e.g. \%album%\%disc% <%title%->\%track%-%title%
  • You can use the file and folder names
  • You can combine tag fields like I put %title% twice here, TagScanner will just concatenate them together
  • You can add text to the field (<%tag filed%> like what I have done <%title-%> to add a "-" after the first part of the %title so that my title tag will be part of the folder name and a "-" and part of the file name
  • You can preview the result before you generate the tags



Mp3tag

After select the folder(s) / file(s), select the file(s), right click and select Convert, Filename -Tag

but it is very slow...

Friday 21 December 2012

Ubiquitous Language

A core principle of domain-driven design is to use a language based on the model.

Wednesday 19 December 2012

Create a DDD Solution


Starting a New Solution

  • Create a Blank Solution
  • Add a Core Class Library Project
  • Add an Infrastructure Class Library Project
  • Add your UI project (Console, WinForms, WPF, ASP.NET MVC)
  • Add references to Core from Infrastructure and UI 
  • Add a reference to Infrastructure from UI

  • Add a Controller, View
  • Add an Interface <IMyInterface> (new folder "Interfaces" in Core) with a method
  • Implement the Interface in Infrastructure (in a class <MyInterface>) with the method
  • In the controller:
  • Add the private field of the <IMyInterface>
  • Add the constructor with <IMyInterface> as parameter
  • Add the constrcutor without parameter to add the parameter
  • In the control, call the method and show the result to the view



Onion Architecture Principles

All code depends on layers closer to center (Domain Model)
Inner layers define interfaces; outer layers implement these interfaces
Layered behavior around the Domain Model
Infrastructure and UI concerns pushed to edge
  • Depend on Application Core, not vice versa



Dependency Inversion Principle (DIP)

High-level modules should not depend on low-level modules.  Both should depend on abstractions.
Abstractions should not depend on details.  Details should depend on abstractions.

Domain-Centric Design / Domain Driven Design

The problem-space of your application is its domain.  If you are going to write a banking software system, you need to have a good understanding of what banking is all about, you must understand the domain of banking.

A domain is something of this world and we need to create an abstraction (a blueprint) of the domain to transform the domain into software constructs.  The abstraction is a model, our internal representation of the target domain.

The model is the common ground, the place where the software meets the domain.

The objects you design to model the domain are domain objects (model objects / model).
  • Encapsulate application business logic and rules
  • Maintain any state required to do so
  • Do not depend on external infrastructure concers


Page Inspector in ASP.NET MVC

Page Inspector in Visual Studio 2012 is a web development tool with an integrated browser and browser tools. Select any element in the integrated browser, and the Inspect feature instantly highlights the element's source and CSS. You can browse any MVC view, quickly find the sources of rendered markup, and use browser tools right within the Visual Studio environment.

It is something like the FireBug add-on in FireFox.

Friday 7 December 2012

Installing SQL Server 2012 Express

Problem:
Cannot find the vc_red.msi file in <temp folder>\redist\visualstudioshell\VC10SP1
  • The file is in the x86 folder insider VC10SP1.  But even I copied the content in x86 to VX10SP1, it is still not work.
  • Try to manually uncompressed the package
  • Run as administrator
Solution:

  • Make sure to download the right version of the setup file.  Download 64-bit version for 64-bit OS.


Wednesday 5 December 2012

C# "??" Operator

The "??" operator is called the null-coalescing operator and is used to define a default value for a null able value types as well as reference types. It returns the left-hand operand if it is not null; otherwise it returns the right operand.

objNullable = objNullable ?? new objMyObject();