I am flying to Minsk this December. If you are considering a new project with our offshore team, let me know this week. Thank you.



Modelus Specification 2.0 is released

Posted on July 5, 2011 02:36 by Aleh Matus

We released a new version of Specification. Download it here. With this new release, we added support for .NET 4.0, .NET 3.5, and Silverlight and provided a number of pre-created collection specifications. Happy coding!




I came across an issue trying to install SQL Server Management Studio on a computer with SQL Server 2008 R2 Express Edition. The installation program started fine but could not find any additional features to install.

The work-around is to choose New Instance during the installation. Everything runs smoothly after that. Happy coding!



VS 2010 SP1 available for download

Posted on March 10, 2011 23:01 by Aleh Matus

Microsoft released Service Pack 1 for Visual Studio 2010. Click here to download the installer.

For more news and announcements, follow me on Twitter: http://twitter.com/alehmatus.




James Steele and Nelson To
The Android Developer's Cookbook

Smart-phone market and mobile web consumption are exploding. Within the next few years, more users will connect to the Internet over mobile devices than desktops. We are in the middle of the next technological revolution.

Android has recently overtaken iPhone in US market share and continues to enjoy widespread adoption among device manufacturers. James Steele's and Nelson To's cookbook helps get started building mobile applications for Android. Organized as a set of independent easy-to-follow recipes, it provides an excellent overview of the fast-growing Android development platform:

  1. Threads, Services, Receivers
  2. Activities, Intents
  3. User Interface elements
  4. Touches and Gestures
  5. Audio and Video support
  6. Communicating with other devices
  7. Location services
  8. Sensors

  

I highly recommend this book to all levels of the experience. Happy reading!

To order this book from Amazon, click here.




In the Part 2 and Part 3 of the Domain Model Structure series, we continued our discussion around how to organize classes inside your domain model. We defined Entities, looked at their relationships, and reviewed options for loading them into memory. This month, we will take a look at Value Objects.

Discovering Value Objects

Value Objects are domain model elements with no conceptual identity. They represent descriptive aspects of the domain and are fully defined by their state. Their behavior depends on what they are, not who they are. If they need to be tracked, they should be tracked with the elements they describe. Thus, they do not need an identity of their own.

We prefer to keep Value Objects immutable, i.e. changeable by full replacement only. Immutable Value Objects are safe to share (which increases performance), and easy to understand (which allows you to build complex behaviors). Let me give you an example based on a classical OO problem:

Assume you have two buckets of paint: b1 and b2. The first bucket b1 contains 1 gallon of yellow paint. The second bucket b2 contains 1 gallon of blue paint. Without looking into the code, could you answer the following questions about the results of the operation b1.Add(b2)?:

  1. What will be returned by the Add method? Is it 2 gallons of green paint or nothing?
  2. What will be in the the first bucket b1? Is it 2 gallons of green paint or 1 gallon of yellow paint?
  3. What will be in the second bucket b2? Is it 1 gallon of blue paint or nothing?

If you notice, we do not have a requirement to track buckets of paint. Thus, I will assume that Bucket is a Value Object and should be immutable. Since both buckets are immutable, they will contain their original values of 1 gallon of paint each and the result of the Add operation will be 2 gallons of green. With no convention in place, it would be impossible to answer these questions without checking the code or better yet unit tests first.

You domain has many Value Objects, a lot more than Entities. If you are having troubles seeing them in your system, take a closer look at the Entities. How are they being described? What are their attributes and properties? How are they being searched for or ordered by? The chances are you will be talking about Value Objects.

Examples: Address, DayPoint, Money, Range, SSN, etc.

Domain Model Structure

Value Objects along with Entities are main elements of the domain model. Many of them are small simple classes that will be widely used in your application. Place them together in a sub-folder under the Domain Model root. We name this folder "Capability":

Domain Model Structure - Capability folder

You are likely to have a number of very complex Value Objects as well. I will try to discuss some of them in my future articles.

Summary and Additional Tips

  1. Never define an identity for a Value Object.
  2. Consider overriding equality operators to match Value Objects using object attributes rather than object references.
  3. Keep Value Objects immutable.
  4. Place Value Objects used across many applications into a dedicated Domain Kernel library.
  5. If you are interested in creating a simple base Value Object class, you can start with the one listed below:

    Domain Model Structure - Value Object Template

Happy coding! To be continued...




Check out these session recordings from the MIX10 conference in Las Vegas (March 15-17, 2010): http://live.visitmix.com/videos/. Enjoy!


Microsoft announced the launch of both Visual Studio 2010 and Silverlight 4 on April 12, 2010 at the ASP.NET and Silverlight conference and expo in Las Vegas. Click here for the conference details.

Happy coding!



OTUG event on Tue, March 16, 2010

Posted on March 16, 2010 12:07 by Aleh Matus

Who: Denis Ahearn and Casey Helbling
What: An Overview of Ruby and Ruby on Rails from the Trenches
When: Tuesday, March 16, 2010, 6:00 - 8:00 PM
Where: Brady Educational Center (BEC) room LL03, University of Saint Thomas, St. Paul Campus
Cost: Free

Visit OTUG for more information.




Michael Feathers
Working Effectively with Legacy Code

To buy this book from Amazon, click here.

Legacy code is defined by Michael Feathers as code that lacks tests. Lack of tests makes the code hard to understand and difficult to change. When the code is changed, new subtle bugs are often inadvertently introduced. When the code breaks, countless hours are spent troubleshooting.

Does it sound familiar? If you are writing software professionally, the chances are you have worked with legacy code many times before. You may be working with legacy code now. If this is the case, you will find Michael Feathers' book invaluable.

  

Michael describes practical strategies and techniques to working effectively with both large and small untested code bases. He explains the mechanics of software change and provides insights into adding tests to and ultimately taking control of legacy code.

I recommend this book to all software developers. Happy reading!



Welcome to ModelBlog

Thank you for visiting ModelBlog. We hope the time you spend with us will be both entertaining and worth your while. Have fun!

Search

Tags