Friday, January 28, 2011

Rely on others and remove impediments

I’ve written before about the Theory of Wringable Necks.  Some people want to put things on people and delegate and not have to care about things.  This is perhaps good management but probably not good leadership.  Leaders are aware that they are the ones who are ultimately responsible and accountable for everything even when things have been delegated.  Life is a team and they’re a key member.1aynqlh0

I have a project manager who asked me to do something and I’m doing it..but slowly.  It’s taking me a long time to learn a new set of technologies and the result is tricky.  If I get it wrong, I break something.  The project manager has not provided me any input or guidance and is expecting me to get the job done.  He just stopped by to ask if I was done and the answer was, “I’m still trying to work out that one last kink.”  He offered no suggestions and simply looked disappointed. 

If you’re going to delegate a task, be prepared to involve others to get the job done.  Never assume that the person that you chose is the right person for the job or that you have the right to wring their neck if things don’t go so well.  Remove impediments for people, find support, and recognize that you (as the PM) are the one responsible for the speed and quality by which something is delivered.

Wednesday, January 26, 2011

The beauty of Inversion of Control

public CoeController() : this(IoC.Resolve<IRepository<Coe>>(), IoC.Resolve<IAuthenticationService>()) 
{ }

A controller that can look up what its dependencies are.


Seems neat.  Still thinking about it.

Inversion of Control, Dependency Injection. Awesome!

This stuff seems so cool and important for being able to test your code.  I just watched this very excellent video from James Kovaks on IoC and DI in C#.  He makes it very simple to use and understand the concepts of why and how to do this.  Great job on this.

Tuesday, January 18, 2011

Knowledge “streams” vs. knowledge as a globe, query, function, service

I think these are two pretty big distinctions in how we think about knowledge and information. 

When knowledge is a “stream” (a book, a web page that you read from beginning to end, a blog post with comments), we consume it in a specific form and have certain expectations.  For example, we don’t think that we can “query” a book unless we have read it.  If the book has a Table of Contents or good Index, then we can access its information.

 

These “query methods” / shortcuts like Indices, Tables of Contents, and Search Engines are short-hand forms of accessing knowledge.  Since humans generally want to “move forward”, they store knowledge in (sometimes disconnected) streams rather than taking the time to update the index.  We build computer systems, search engines and other technologies to “mine” our knowledge, but we’ll probably never be able to keep up with the steams of information that are being produced (both on- and off-paper).

Monday, January 17, 2011

Looking for a UI control that will allow me to do bulk adding with edit and delete

I’m working on a couple of projects now that have the need for quick-edit lists.  (Lists of free-form things like Actions, Reasons, etc.).  I want the user to be able to quickly add a lot of these items, almost in a brainstorming type way.  Editing and deleting the items should also be easy. 

Here’s a quick mock-up of what I’m trying to accomplish:

eejn0snh

I see an article and video on the web from Elijah Manor (a .NET MVP) about hooking up a control called jqGrid (download page is here) that works with .NET MVC.

It looks like it could be a lot of work to use that.  I may roll my own method but I’m not yet sure.  TBD tomorrow…

Sunday, January 16, 2011

CTP5 [DataAnnotations]

DataAnnotations are sweet! 

The MSDN announcement to CTP5 has a listing of the Data Annotations provided.  Here they are formatted for your enjoyment:

  • Key
  • StringLength
  • MaxLength
  • ConcurrencyCheck
  • Required
  • Timestamp
  • ComplexType
  • Column    - Placed on a property to specify the column name, ordinal & data type
  • Table - Placed on a class to specify the table name and schema
  • InverseProperty - Placed on a navigation property to specify the property that represents the other end of a relationship
  • ForeignKey - Placed on a navigation property to specify the property that represents the foreign key of the relationship
  • DatabaseGenerated - Placed on a property to specify how the database generates a value for the property (Identity, Computed or None)
  • NotMapped - Placed on a property or class to exclude it from the database

Many-to-Many table mapping in EF CTP5

Was just reading that the method of many-to-many mapping is different in CTP5.  Here’s the method:

public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Store> SoldAt { get; set; }
}

public class Store
{
public int Id { get; set; }
public string StoreName { get; set; }
public ICollection<Product> Products { get; set; }
}

public class MyContext : DbContext
{
public DbSet<Product> Products { get; set; }

protected override void OnModelCreating(ModelBuilder modelBuilder)
{

modelBuilder.Entity<Product>()
.HasMany(p => p.SoldAt)
.WithMany(s => s.Products)
.Map(mc => {
mc.ToTable("ProductsAtStores");
mc.MapLeftKey(p => p.Id, "ProductId");
mc.MapRightKey(s => s.Id, "StoreId");
});
}

Saturday, January 15, 2011

My volunteer experience today

I had a fun day at Seattle GiveCamp today.  I worked with a couple of guys from MokaSocial to create a mobile app for a conference.  It’s going to be available on iPhone, Android, Blackberry, and Windows Phone.  It is a “skin” for a WordPress site and detects the user’s phone.

4q0prk4e

Friday, January 14, 2011

Scrummerfall

rzliwivdDo blended / hybrid models work?  For some.

You can be a waterfall project manager and set commitments with the customer that way.  You can get commitments from developers that they’ll hit targets but they might not.  By doing Agile, you handle risk on a daily scale and can track things in real time.

They’re not mutually exclusive, I think they support each other.  One helps plan long-term and set expectations with the customer and the other helps get work done in the short term and manage risk and communications.

They work together and together they can make you successful.

s1xynzrd

I can paste code to my blog now!

Probably not exciting for you, but it is for me!  Check it out:

C# block:

namespace TestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void SystemTracksWorkflow()
{
var c = new CoeController();
c.Create(4);

c.DoAction(c.CoeId, ActionName.OpenCoeSystem.ToString(), "system", "marla", "stuff");
//Assert.AreEqual("Open", coe.Status);

c.DoAction(c.CoeId, ActionName.AssignCoe.ToString(), "marla", "eric", "Please look at this, it looks really messed up.");
//Assert.AreEqual("Assigned", coe.Status);

SQL block:

CREATE TABLE [dbo].[Coe](
[Id] [int] IDENTITY(1,1) NOT NULL,
[ClassId] [int] NOT NULL,
[Created] [datetime] NOT NULL,
[StatusId] [int] NOT NULL,
CONSTRAINT [PK_Coe] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

XML block:

<configuration>
<connectionStrings>
<add name="COEConnectionString" connectionString="Data Source=.;Initial Catalog=COE;Integrated Security=True;Pooling=False"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>

I spent a very long time yesterday trying to make this work.  I have a Blogger (BlogSpot) account and I want to use Live Write.r  I gave up yesterday after many trials but had to make it happen today.  I did.


Here are the instructions from MLA Wire about getting this working in Blogger and the instructions from Yordan Pavlov about getting SyntaxHighlighter marked up within LiveWriter.  I know Scott Handselman had a post about this a long time ago and I remember reading it and being excited but I never got it going.  But I have it going now! 


At least my posts will be more colorful and interesting now.  I’m still looking for a good Live Writer plug-in for pasting images.


  lckq1dqk


I pasted this one in with the Clipboard Live plug-in…not sure if it did anything good.