Jim's Blog Ramblings about novels, comics, programming, and other geek topics

27Sep/071

“Who Am I” follow up…

Google AdSense

I stumbled upon The Nerd Tests (version 2) and just needed to see for myself who I was.  After taking the test, it calculated that I was a ... Uber Cool Nerd. Ha! Beat that! :)

Nerd Test - Uber Cool Nerd

  • Science / Math: 32%
  • Technology / Computer: 82%
  • Sci-Fi / Comic: 67%
  • History / Literature: 16%
  • Dumb / Dork / Awkward: 3%
27Sep/072

Who Am I?

Google AdSense

One of the Podcasts that I listen to is the Alan Watts Podcast. If you haven't heard of Alan Watts, then you probably have never read much western philosophers of the last few decades. He has written tons of books on religion and philosophy.  Just recently, some of his talks were converted to electronic media and are being released for free via Podcasts.

In a 1965 lecture at Southern Methodist University at Dallas, Texas, he stated that most westerners think of ourselves as a "as a skin encapsulated ego". We (westerners) don't regard ourselves as "identical with our whole physical organization", instead we represent ourselves as something imprisoned within our physical bodies - such as a spirit/soul separate of a body.

When most westerners are asked where are you, they may point to their brain or some region within the skull. And somehow that part controls the body but is not itself part of the body. This is quite different from eastern philosophies might state state that their entire physical body is themselves and that there is no single part of themselves that is more them than another part of their body.

Western men have long been under the influence of two great myths: image of the world as an artifact and the image of the world as a result of random collisions...

Note: Myth does not mean false or not true. Myth is defined as "a traditional story accepted as history that serves to explain the world view of a people" (WordNet).

Mr. Watts goes on to describe some eastern philosophies as thinking of nature as something that grows and not made, such as seeds turning into plants. And the concept of identifying ourselves with our entire physical being.

All of his talks have been interesting, but short.  Most of the podcasts are less than 20 minutes and some lectures, such as this one, are oftentimes split into multiple podcasts which are have been once a week postings.

Curt of Can't See the Forest also writes about this recent lecture. He provides a little more insight into the ideas presented by Mr. Watts.

 

My Related Posts:
27Sep/070

Why are you writing that code?

Jeff Atwood of Coding Horror writes a nice article on the purpose of writing code by posing the question as an elevator test to a team of coders. An elevator test is the ability to explain something to someone during an elevator ride (typically less than a couple minutes).

If the developer can't answer why he is writing that bit of code, then that usually means they don't really understand what they are doing or why they are fixing something in the bigger context of the project/product.

Jeff concludes stating that "every person on your team should be able to pass the 'elevator test' with a stranger -- to clearly explain what they're working on, and why anyone would care, within 60 seconds."

Software developers think their job is writing code. But it's not.* Their job is to solve the customer's problem. Sure, our preferred medium for solving problems is software, and that does involve writing code. But let's keep this squarely in context: writing code is something you have to do to deliver a solution. It is not an end in and of itself.

The article is a good read and hopefully should give some developers a pause to consider what they are doing before they jump head first into writing that bit of code.

My Related Posts: ,

21Sep/072

When is a SQL Server Database not a SQL Server Database?

Answer: When it is a Microsoft CRM 3.0 database.

The Microsoft CRM is built using a SQL Server database. So that means anyone who can connect to the database can perform database operations on it. This also means that developers could build applications or user interfaces to the data without using the CRM user interface. Any user with a valid SQL Server account can connect to a SQL Server database using ADO, ADO.NET, ODBC, OLE DB, JDBC, etc.

Sometimes, you may need to write a user interface outside of the Microsoft CRM user interface. For example, if you just want to make a simple web page that allows someone to submit a few items of data (such as a "contact us" page) and then insert it into the CRM database. Otherwise, you would need to teach the user how to use the CRM user interface.  Also, maybe you'd like to display a list of items on an intranet web page that makes reporting quick, easy, and accessible. Sometimes it's just not feasible to have every user that may supply or view data use the Microsoft CRM user interface.

Another reason (why I'm writing this) is that you may have another system that just needs a little bit of data from the CRM's database. The other system may have very little to do with the CRM, but just needs a few values from the database. The other system may even have its own database that might just need to refresh the shared values at a specific interval, so there's no direct querying of the CRM database.

The easiest option would be to link the SQL Servers (the CRM and other database). Another option would be to use a third-party to map the fields and migrate the data at a standard interval (such as nightly). Lastly, you could just write batch files to perform SELECT, INSERT, UPDATE, etc. statements to keep the two systems in sync.

Well if you're thinking about any of those options then that's when the "Microsoft Dynamics CRM 3.0: External Connector" is needed. Basically, it is an approval letter saying that it is okay for you to connect to the CRM database.  The CRM license costs about $2,000 USD per server and each user license costs about $1,000 USD each.  The External Connector license costs about $15,000 USD regardless if you are building a complete user interface to replace the CRM or if you are just copying some values from one database to another database.

So of course, there's a lot of confusion over the license. Does this mean that if I send an email to someone that's not a CRM user, then I require a an external license since the end-user is does not have a valid CRM CAL? What if someone copies data from CRM database into an Excel spreadsheet and then emails it? What if a CRM GUID (PK) value is stored in another database that is used to build a hyperlink to the CRM user interface that only valid CRM CAL users can access? What if the values are entered manually into another database by a user that has a valid CRM CAL. would other users be able to view that value even though it is not directly connected to the CRM database?

 

15Sep/070

The Rise and Fall of Database Administrators

Diego Parrilla posted a great story/rant on the changing role of DBAs in an increasingly ORM development environment titled "Rise and fall of DBAs: The tyranny of the ORM".

There was a time when DBAs dictate how developers should use Their databases. It was early and mid-nineties and Their Word was The Truth...

And then a new trend started: move out of the database as much business logic as possible. The web developers started to code the SQL inside the application to relief the database.

IT Manager: And we can also transfer all these development tasks to the development team. Right?
DBAs: Correct, but...

 

My Related Posts: , ,

14Sep/070

Simplify Your Data Access With ORM Automation

Every now and then, I stumble upon something worth saving. The SubSonic project is an open-source project that generates a Data Access Layer (or Data Abstraction Layer) for your .NET projects.

At first, I wasn't very familiar with ORM (Object Relational Mapping). I've been writing SQL statements for many, many years. Mostly, just because I've been surrounded by data-centric personnel such as DBAs or I've had to take on the role of a DBA.

Here is an example of how to query the "Change_Request" table to retrieve the top 10 records ordered by the created_on column.  For the most part, many of my ASP.NET web sites look like this. It is very easy to generate the SQL and this example doesn't even show a select command with several join statements and complex where clauses.

 <asp:SqlDataSource ID="sqlTop10Requests" runat="server" 
      ConnectionString="<%$ ConnectionStrings:SCR_Database %>"
      SelectCommand="select top 10 change_request.* 
              from change_request 
              where Project_id=@appId 
              order by created_on desc">
     <SelectParameters>
         <asp:QueryStringParameter Name="appId" 
             QueryStringField="appId" Type="string" />
         </SelectParameters>
</asp:SqlDataSource>

Now, this code was converted over to use objects generated by the SubSonic project.  Below is how my code looks now:

Query qry = new Query(ChangeRequest.Schema)
     .WHERE(ChangeRequest.Columns.ProjectId, projectId);
qry.Top(10);
qry.OrderBy = OrderBy.Desc(ChangeRequest.Columns.CreatedOn);

Although, you may be saying that it is still rather complicated. I see it that my biggest benefit is that everything is now strongly-typed. If the field named "Created_On" is renamed to "Created_On_Date", I can just refactor my code to make the change and if it compiles, then I know I found every instance and fixed it.

If a column was renamed when I am using the inline SQL (the first example), I'll have to rely on text searching and looking at each individual page and query statement to determine if the field is owned by the table that was modified.

Here's another way of querying using SubSonic:

ChangeRequestCollection crs2 = new ChangeRequestCollection()
     .Where(ChangeRequest.Columns.ProjectId, _projectId)
     .OrderByDesc(ChangeRequest.Columns.ClosedOn);

The only reason that I can't use the above code is that the TOP function isn't supported by the fluency chaining (see message board over at subsonic for details).

 

My Related Posts: , , ,

13Sep/070

Yummmm. Bacn’s better than Spam

There's a new term generating a lot of buzz over the last month. It's "Bacn." It is similar to Spam, but Chris Brogan sums it up nicely saying:

It’s any email you receive that isn’t spam, but isn’t exactly a personal message either. Your electronic phone bill is bacn. Your Google alerts are bacn.

The term Bacn originated from the PodCamp Pittsburgh and was first blogged about by Andy Quayle's What is 'bacn'? post.

Bacn consists of all of those emails that you might have actually signed up for and you want to read, but the emails are so unimportant that you can delay reading them - sometimes forever. Some of the bacn emails might just get deleted unread instead of actually unsubscribing from the alerts/notices.

References:

My Related Posts:
13Sep/072

Does Programming Ruin Lives?

The application of programming specific processes and habits to the everyday is where peril lies. The same traits that make you a great programmer can make you an awkward, misunderstood and miserable human being.

A couple days ago, an essay was posted over at Devizen.com that goes through the details of how Programming Can Ruin Your Life.

Here's a few links relating to the publication of that article, in case anyone is interesting in reading more.

My Related Posts: ,
8Sep/071

Thoughts on Data Abstraction

On my path of becoming a better developer, I've began participating in the development of DotNetKicks. DotNetKicks is an open-source project that is a community driven link submission portal. In other words, it is very similar to major web sites of Digg and Reddit, but its focused into specific areas of technology.

DotNetKicks.com is a community based news site edited by our members. It specializes in Microsoft development techniques, technologies and tools including ASP.NET, C#, VB.NET, C++, Visual Studio, Team System, SQL Server and Microsoft Vista.

Like most open source projects, the project uses Subversion. I've used SVN a few times before for other open source projects. In the past, I've just used the SVN command line. But this time, I downloaded and installed TortoiseSVN and it has worked great so far.

I've been able to address a couple enhancement requests including adding a way to see which stories a user has submitted (DNK issue 24) and see all of the comments submitted by the user (DNK issue 62). These were two pretty simple fixes that were resolved by adding some stored procedures and a little bit of coding. Gavin Joyce, project lead, writes about the new features recently added to DotNetKicks on his blog.

One of the things I've notice from reviewing the code so far, is the use of a data abstraction and business layers. In most of my work so far, I've seen very little implementations of these layers. Most of the projects that I've written or reviewed had the presentation, data, and business layers combined into the web page (either ASP.NET or JSP).

There are advantages and disadvantages to using data abstraction layers and nearly everyone does it or reads about it for academic reasons. The largest benefit is transporting the database to another vendor or platform. You can just edit the DAL instead of going through each page and updating your SQL code for any RDBMS vendor specific code.

But that doesn't happen very often for most internal company web sites. For the most part, I've worked on Oracle databases for the government and SQL Server databases for commercial and in-house projects. I've never been apart of something that need abstraction for portability.

One of the advantages that I found is the use of strongly typing the data. When directly querying a database and just outputting the contents, its impossible to test for the existence of columns at design time. With an automated build process that generates the DAL, you can find errors when referencing database objects that may not exist or be of a different data type that you code in your presentation layer.

The DNK project uses SubSonic to automatically generate a data abstraction layer for its SQL Server 2005 database. SubSonic is an open-source project that can generate data abstraction layers for SQL Server 2000, SQL Server 2005, MySQL, and Oracle databases.

An alternative to SubSonic is to use Strongly Typed TableAdapters. Scott Gu provides a detailed tutorial on how to build a data abstraction layer using Visual Studio.

 

My Related Posts: , ,
6Sep/071

Becoming a Better Developer

I came across Justice Gray's post titled How I am becoming a better developer a few months ago, but the idea just sat in the back of my mind for a while. He claimed that the first steps of becoming a better developer are writing it down and sharing it with someone else.

The "better developer challenge" started with that post. He challenged a handful of developers who then challenged more.  All over the blogosphere, developers began challenging fellow developers to become better developers.

This blog was one of my first steps of becoming a better developer. By stating my goals here, I am able to accomplish both of the first steps.

Here are my six month goals:

Read code

I want to read through four different open source .NET projects within the next six months. Some good links for open source projects can be found from Scott Hanselman's Weekly Source Code posts.

Read books

  • Read one software engineering related book
  • Read one language specific related book
  • Read one software testing specific related book

I'm starting on reading the C# Language Specification version 3.0. Although, most of this document will just be review, I've already found some new things that I didn't know and I'm learning a few new things about the next version of the .NET Framework.

Listen

In addition to non-coding podcasts, I want to subscribe and listen to a few different podcasts. I haven't selected the podcasts, yet, but I want to cover a few different topics including general technology, .NET, and software engineering/design.

Write/Blog

I've started a blog and I want to keep posting software engineering and coding articles in hopes of becoming a better writer and developer by the means of community review and discussion.

Participate

I want to participate in more discussion/review of fellow developer's code and blog entries.  I also want to contribute to coding communities and maybe even join an open source project.

Challenge

If you're reading this and most likely you're a developer also, then you should take up the challenge to write and share your goals to becoming a better developer.

My Related Posts: ,