Thursday, February 12, 2015

How to check TcpListener is listening?

In TcpListener class, there is a property called Active but it a proctected one.
https://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener.active(v=vs.110).aspx

Solution:
Create a sub class from TcpListener, and expose this property by yourself.

Code example:
    public class Listener : TcpListener
    {
        public Listener(int portNumber): base(IPAddress.Any, portNumber) {}
        public bool IsAcitve
        {
            get { return this.Active; }
        }
    }

Wednesday, February 11, 2015

What is projection in event sourcing

Projection is about deriving current state from the stream of events
Reference:
http://abdullin.com/post/event-sourcing-projections/

Quote from Ralph Johnson: Before software can be reusable it first has to be usable.

Reusable software is not number one priority anymore. So why want to design software to be reusable.

Tuesday, February 10, 2015

Reading about CQRS and event souring

Exploring CQRS and Event Sourcing
https://msdn.microsoft.com/en-us/library/jj554200.aspx

Applying CQRS and Event Sourcing in Microsoft .NET Applications TechEd Europe 2014
https://www.youtube.com/watch?v=z5FPkCgcH4M

Monday, February 9, 2015

What is bounded context?

From DDD website:
[[Bounded Context]] The delimited applicability of a particular model. BOUNDING CONTEXTS gives team members a clear and shared understanding of what has to be consistent and what can develop independently.
http://dddcommunity.org/resources/ddd_terms/

From Martin Folwer:
Bounded Context is a central pattern in Domain-Driven Design. It is the focus of DDD's strategic design section which is all about dealing with large models and teams. DDD deals with large models by dividing them into different Bounded Contexts and being explicit about their interrelationships.
http://martinfowler.com/bliki/BoundedContext.html

From MSDN
The term bounded context comes from Eric Evans' book. In brief, Evans introduces this concept as a way to decompose a large, complex system into more manageable pieces; a large system is composed of multiple bounded contexts. Each bounded context is the context for its own self-contained domain model, and has its own ubiquitous language. You can also view a bounded context as an autonomous business component defining clear consistency boundaries: one bounded context typically communicates with another bounded context by raising events.
https://msdn.microsoft.com/en-us/library/jj591575.aspx

From "DDD: The Bounded Context Explained"
http://www.sapiensworks.com/blog/post/2012/04/17/DDD-The-Bounded-Context-Explained.aspx

really Explained?

Same question at
http://programmers.stackexchange.com/questions/237513/what-in-reference-to-ddd-is-a-bounded-context

Conclusion:  bounded context is a fence.

How come a key concept in DDD is with so many ambiguous definitions?
:)