key argument of InsertOnSubmit method

Coordinator
Oct 9, 2011 at 6:57 PM

Now, InsertOnSubmit method is implemented like following code.

public void InsertOnSubmit( string columnFamily, byte[] key, Column column)
{
    this.ValidateNotDisposed();
    this._MutationMap.AddInsertion(columnFamily, key, column);
}

 

When we use this method, we write next code.

InsertOnSubmit( "ColumnFamily1", "key1".ToCassandraByte(), column );

 

But I want to write next.

InsertOnSubmit( "ColumnFamily1", "key1", column );

 

My guess is that we should implement InsertOnSubmit method like next.

public void InsertOnSubmit( string columnFamily, object key, Column column)
{
    this.ValidateNotDisposed();
    this._MutationMap.AddInsertion(columnFamily, key.ToCassandraByte(), column);
}

 

If we introduce this way, we can write logic by more little code. But second argument may be hard to understand that is key argument.

What do you think?

public void InsertOnSubmit(

            string columnFamily,

            byte[] key,

            Column column)

        {

            this.ValidateNotDisposed();

            this._MutationMap.AddInsertion(columnFamily, key, column);

        }
Developer
Oct 10, 2011 at 2:37 PM

Sounds like a good idea to me.

Coordinator
Oct 10, 2011 at 7:59 PM

I make workitem. Click this to move workitem page.