Identity Interface header image

97 Things Every Architect should know

As spoken by Richard Monson-Haefel at the Java User Group Meeting put on by TekSystems.

We covered ten general themes in the short amount of time we had.

  • The user interface is critical
  • Nothing Lasts
    • Cobol, Smalltalk, Waterfall, nothing in software lasts. Chances are if you think it will last you just need to wait longer.
  • Data is forever
  • Flexibility breeds complexity
    • Something that is flexible is almost always complicated, but if something is designed to be simple it can be flexible.
  • Manage your expectations
  • Know thy business
    • The business is key to making great decisions in architecture. You have a responsibility to know all of aspects of the business side and technical side. Similar to a CIO but you get paid a lot less.
    • Understanding the business domain
  • Maintain the vision
  • Software architects should also be coders
    • Take some time every week to sit down with the coders. You will figure out what their pain points are and it will help you make better architectural decisions.
    • Share your knowledge and experience
  • There is no substitute for experience
    • Creating software is a trade. It is learned over time, and best learned by working with great people. It is similar to being a plumber or an electrician. You go to class for a little bit, and then you work as an apprentice. Architecture is no different.
  • The list in its entirety can be found at

    97 things every software architect should know the book


Sql Server Compact - Access to the database file is not allowed.

Lately I have been playing with some small client apps, just kicking the tires on a few of the new microsoft technologies.

For the underlying database I chose Sql Server Compact Edition. Since I am using Linq to Entities, stored procedure support is not necessary.

I wrote a few tests against the database and found that the database was not being deployed along with the tests.  Here is app config entry |DataDirectory|\DataLayer\PhotoStore.sdf. 

I copied that from the Common Library, when the test was ran the entry parsed into  TestResults\Jon_JON-PC 2008-10-20 18_57_13\Out\DataLayer\PhotoStore.sdf

The first error was the obvious file not found error.

My first instinct was just to try and copy it to a common directory. I received the exception below.

System.Data.EntityException: The underlying provider failed on Open. —>  System.Data.SqlServerCe.SqlCeException: Access to the database file is not allowed. [ File name = C:\Users\Jon\Documents\PhotoStore.sdf ].

Resolutions

1. Turning off UAC.

2. Point the tests app.config to the database file in the corresponding app directory.

3. Run Visual Studio as administrator.

4. Create a build task to deploy the database in the test directory (TestResults\Jon_JON-PC 2008-10-20 18_57_13\Out)

I think the reason this is happening is because of the LUA model of security. When I copy the data file into  directory like Users/JonShern/Documents by default the test process is running as a least privileged user, so it not able to write to this file.  Admittedely my understanding of the inner working of security are lacking, seems like it just ends up to be the guess and test method of problem solving:(

I think 1,2 and 3 seem a little hackish to me. But man to write a build task for a little app is just overkill.

Here is a code sample that someone is using for deployments.

SecurityIdentifier sid = new SecurityIdentifier( WellKnownSidType.BuiltinUsersSid , null );

FileSecurity dbSec = File.GetAccessControl( dbFile );

dbSec.AddAccessRule( new FileSystemAccessRule( sid , FileSystemRights.Write, AccessControlType.Allow ) );

File.SetAccessControl( dbFile , dbSec );

References

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1892312&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3455426&SiteID=1

Letter to Rookie Developers

Dear Rookie Developers

First off let me start by saying I am still a Rookie in a lot of ways. I still make plenty of stupid mistakes and I still forget to submit my hours on time:)

I have been on a few development projects and have learned a lot about how to develop software. Admittedly I still am not sure on what is the best way to develop software, but I have some advice on the pitfalls and things that I think were bright spots on my rise to programming mediocrity.

Get help early and often.

Don’t be embarrased to ask a senior developer how he/she would implement a solution. I do it all of the time. None of us really know the best solution, we just know the best solution in relation to the solutions that we have seen.  Push for code reviews they are an invaluable tool into the mind of another developer, try and study the code before hand so you have some context on the problem at hand.

Read code

Scott Hanselman talks about it all of the time.

Code is interesting, how else are you going to get the best practices that are going to keep you on the good side of your developer comrades.

Be proud of your work, but don’t be afraid to throw it in garbage.

It is great to be proud, but we need a healthy mix of pride and realism.  A lot of times I will write a method and just delete it and rewrite it. It you are doing TDD then the second time your code will probably be a lot cleaner and more efficient.

Read Code Complete

There is a lot of great advice in Code Complete that every developer should be familiar with.

Start out thinking about testing

When you start coding, think about how easy it will be test this method. The more you do that the easier the jump TDD will become.

Learn new languages

As computer scientists we are abstract thinkers. That is one of the many reasons that math is taught to us.  It gears us up for the abstractions that are on the horizon. By learning new programming languages we learn on how to approach a problem on a whole new level. It can also help us identify improvements that can be made in our process. Just look at what has happened in the Java world, and the .net world. Seems like we have a constant trickle of Java tools being ported over to the .net world.

These are just a couple of things you can do to improve your craft. But keep in mind development is like a trade. When you first start out we are all just apprentices, we learn from others on the best ways to approch problems, and code. We perfect our craft and hopefully one day we will be masters at our trade.

Database Edition now available from msdn

Just noticed that Database Edition is available to download with my msdn subscription.

Before it was about $3000 to buy, I wonder why there are just giving it away now?

I supect it has to do with the fact that currect dbas are heavily entrenched in their tools and practices, and don’t want to change.  By giving it away for free, they can get the developers on board and get them to show the dbas how nice the tool works.

Conveying Complexity with Simple examples or analogies

Google just released there new browser Google Chrome

It is beatifully simple piece of coding, in which each tab is broken into its own process.

Each process can then spawn child process which correspond to various plugins, such as shockwave flash, etc.

This is a great way to isolate your processes from other errors, essentially it is a mini-os wrapped in a browser.

This can be a difficult concept to wrap your head around and the cartoon that was produced is an excellent way to understand the nuts and bolts.

Some cartoons that convey difficult concepts.

Google Chrome

Why we need architects

What is perpendicular storage

Design Patterns

SOA is something that is often defined using analogies such as Legos,  Transportation, or the post office.

It pays to think of things at their simplest level, it will really be helpful for you when attempting to convince others or your brilliance:)

Isle Royale Photographs

Travis Novitsky has taken some really beautiful photographs of Isle Royale and Northern Minnesota.

Isle Royale Vacation Log

Recently I took a backpacking trip out to Isle Royale National Park

Day One - August 16th 2008  6.9 Miles

Left from Grand Portage MN at 8:00am on the Voyageur II.

The boat blew a head on the way to Windigo so we had to change our plans and leave from there.  Hiked 6.9 miles to Island Mine where we camped. Everyone was pretty sore and the water source was pretty scarce.

Day Two — 5.5 Miles

Hiked to South Lake Desor. The forest was mostly sugar maple when we started and as we got to Lake Desor the scenery started to change to a Birch forest. The lake was nice, there was a nice beach over by the group camp area where we could cool off. There was a pretty good wind that day and Bryan and our neighbors witnessed a big dead birch tree fall over. It kind of spooked us. Later in the night, after we had convinced ourselves it would not happen again, we heard another tree fall in the distance. We were a little nervous when we went to bed, but we made it:)

Birch Forest

Birch Forest

Day Three — 8.1 Miles

On the way out we say a Cow Moose grazing. Pretty Cool.

By this time we were pretty well acclimated to the hiking.  I think the soreness was all gone by day two.

The Green Ridge Trail started to open up into some really some nice views of the island.  There was lots of great views of the mountains in Canada. It was much more impressive than I had ever imagined.  That day Bryan rigged up a berry pickin’ container, so we spent most of the day gathering Thimble berries. After pickin’ berries all day we got to Hatchet lake late and got the last campsite. It really sucked.  The lake did not have much access to it, so we went to bed pretty early.

Canadian Shoreline from Greenstone Ridge

Canadian Shoreline from Greenstone Ridge

Moose

Moose

Day Four – 3.9 Miles

After seeing the beautiful views of the Canadian mountains we decided to hike over to Todd Harbor which is on the north side. We got there early enough to get a shelter. The spot was pretty close to the lake. I hiked over to a small waterfall about a half a mile from camp.  We laid around until the sunset. The sunset over lake superior was amazing.

Todd Harbor Shelter

Todd Harbor Shelter

Todd Harbor Sunset

Todd Harbor Sunset

Day Five — 8.9 Miles

We hiked through McCargoe Cove to East Chickenbone. McCargoe Cove was pretty exposed and busy. There was a nice dock and place to swim. We had our sights set on East Chickbone to put us closer to Daisy Farm. The east chickenbone campsite was ok, it was pretty open and in the middle of birch valley. The lake was about 1/4 mile away. Three people from Tennessee joined us because the campground was full. Pretty interesting group, it was nice to hear about Smoky mountain national park. At sundown we went down and fished.  I caught a good size walleye. I think Bryan did too, but his snapped the swivel before he could get it up to shore.

Jon's Big Fish

Jon's Big Fish

Day Six – 7.4 Miles

Hiked to Daisy Farm. There was a real nice beach there. It was pretty busy. It seemed to keep getting busier as we approached Rock Harbor.

Day Seven — 4.2 Miles

Three Mile. We got a shelter that had access to an awesome rock to just sit on and read. The last couple of days our hikes were pretty short so we had plenty of time to just sit around read, and play hour long games of crazy eights.

Day Eight — 3.6 Miles

Rock Harbor. Ahh Civilization. After craving burgers for eight days it was finally real. Admittedly I had imagined it would taste so phenomenal, but it fell really short.

Day Nine

Woke up at 7:00am for the boat ride. Pulled into Windigo about 1:00pm. Asked the boat people how long the stop would be. They said about 30 minutes. Bryan and I sprinted up to store and ordered a pizza. Twelve minutes later we had our pizza. The lady said once the boat blew its horn we would have 10 minutes. The boat blew its horn and we started cramming the pizza down. We ran down and found the boat was leaving. We had to sit there as the boat turned around. After we went through the embarrasment of missing the boat, we sat through the remainder of our 10 hour boat ride.

When you are away from modern amenities for any period of time it is amazing how much you crave them. You gain a new appreciation for a little while, but once you satisfy the craving you immediately begin to take it for granted.

Mac Heat Problem and the Print Queue

For a few days now, I have noticed that my mac has been running very very hot.  Around 160 Degrees fahrenheit.

I noticed that the cpu is pegged.

I think since it is dual core the system doesn’t hang so it was not noticeable in regards to performance.

The culprit was the print queue. I killed it a few times and it came right back. I looked at the print queue and there were a couple of jobs stuck in there.

I deleted them and cpu went back down to normal.

I am already noticing a big difference in both temperature and battery life.

Creating File Paths in C#

Path.Combine is an easy and reliable way to combine path and file information.

Before

DataFile = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + "samplefile.xml"

After

DataFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"samplefile.xml");

When using Special Folders you need to call Environment.GetFolderPath to return the actual path.

ObservableCollection Namespace

Don’t forget to add a reference to WindowsBase when you need to work with ObservableCollection in WPF.

I am a big fan of naming assemblies according to the contained namespace. That is why it always takes me a second to realize that System.Collection.ObjectModel.ObservableCollection<T> is in the WindowsBase namespace assembly.