.NET Framework 1.1 & 2.0 Runtime Compatibility

by Erik Lane 28. February 2006 06:58

I got this from The Daily Grind today and it goes into some great detail and explanations on the subject.  The only issue I've had thus far is trying to run 2.0 and 1.1 in the same app pool.

Here's a direct link to the article.

Tags:

Part 1 - Integrating Plug 'N Pay with Storefront Shopping Cart

by Erik Lane 27. February 2006 08:54

Storefront 6.0 (SF6) comes with over a dozen payment systems already integrated into it.  But there is always someone who wants one that is not there and this time its Plug 'N Pay.  SF6 does have a good help file that comes with a tutorial to integrate a payment server.  It outlines the 5 steps needed to accomplish this task.

Step 1: Adding the Payment Processing Service to the Store's Database
Step 2: Add a new case to CProcessor.CallProcessor()
Step 3: Creating a New Processor Class
Step 4: Handling the Results of the Transaction
Step 5: Indicating the Success of a Transaction

In this post I'll discuss the first two steps to integrate Plug 'N Pay (PNP) using the pnpcom.dll.  There are other ways to process payments to PNP without using the COM object but I've found this to be pretty straight forward and so that's what I'm rolling with.

Step 1: Adding the Payment Processing Service to the Store's Database
In the SF6 database insert a row into the Payment Processors table.  There are 17 columns in the table but for PNP I only need to use 4.  These are the 4 columns I'm using, their pseudo values, and the PNP variable name if applicable.

Column Name Value PNP Variable
Name PlugNPay n/a
MerchantID BobCobb Plublisher-Name
UserID bob@cobb.com Publisher-Email
LiveServerPath mode=debug&publisher-name={0}&publisher-email={1}&card-name={2}&card-number={3}&card-amount={4}&card-exp={5}/{6} n/a

If you notice the live server path is going to be used later in the code as a value in a string.format method.  Also the live server path is set for debug mode and when it goes live you'll want to remove that.

Step 2: Add a new case to CProcessor.CallProcessor()
Now PNP can be selected through the store’s Merchant Tools.  So now is the time to write the code to detect when its the payment processor being used.  The code responsible for this task is CallProcessor() and is located in StoreFront.SystemBase.Processors.  This ElseIf statement detects the name of the processor being used, instatiates a new PNP object based on the current order, sends the request, and then handles the error message if any.  So locate this ElseIf statement and then add in this piece of code.

   ElseIf Name.ToLower = "plugnpay" Then
                    Dim objPlugNPay As New CPlugNPay(Order)
                    objPlugNPay.sendRequest()
                    Message = objPlugNPay.ErrorMessage

 


Obviously we've not created the PNP class being used here but that's step 3 and we'll get to that in the next post.

Tags:

Mail-In Rebate Goodness

by Erik Lane 27. February 2006 04:08

I don't normally look at a mail-in rebate as a good deal.  I'm still out the money until I get the rebate back in 3-4 months.  This is still dependent on me sending the rebate off and them actually processing it and getting me my money.

Anyway, I was a pleased to get a nice confirmation e-mail from Linksys today that they've received my latest rebate request that came with my new router and I should expect the check in two weeks.  The email also gave me a tracking number I could use to check the status of my request on this website.

This still doesn't speed up the process (submitted in early December and today is February 27th) but at least I know I'm going to get my $15!

Tags:

Dissecting a C# Application: Inside SharpDevelop

by Erik Lane 21. February 2006 04:58

Through Christopher Steen I found Ohad's link to 8 free e-books on the APress site.

The one that I downloaded was Dissecting a C# Application: Inside SharpDevelop.  It goes into the pieces of the app and discusses how things work and what issues they ran into.  Its one of those project that started out as a one man show but then grew into what it is today.  One chapter I really liked (and paid most attention to) was the second chapter:  Designing the Architecture.  This is some good stuff for guys like me who like to know the thought processes that go into building an application.  The piece of chapter two on design patterns was of special interest to me as I'm still getting my chops around design patterns.  I know what they are and I'm realizing I unknowingly use them a lot; I just don't know their names or the book definition very well.  Though the reviews on amazon aren't that great I wasn't looking for to much from it.  So what I did get was good.

Chapert Two:

In this chapter, we will be looking at the history of SharpDevelop and its basic design concepts. Also, we
will be discussing the practices used in the SharpDevelop development process. Some of our practices and
methods might seem unusual, but we want to tell the truth about our development process; ...This chapter lays
the foundation for understanding the succeeding chapters and, in any case, it's good to know how a technology was developed.

Correcting Bad Design Decisions

In this section they discuss some of the history of the project and some decisions that were made early on that reared its ugly head as issues later on.  I know this happens to all of us but its comforting to hear it too.  One example they discuss is originally using an ArrayList for the editor's data structure.  They then realized the editor itself had become a beast and basically rebuilt it from scratch and in doing so change the editor's data structure to a linear model.  They go into the reasons behind the decision (like reviewing literature on other editors) and the advantages of the decision (like increase performance).

The Design Decisions
This section discusses their outline that defined their design.  For example - ease of deployment and having few dependencies on a user's machine and using the Model View Controller (MVC) model.

  As we can see from the diagram, the controller is between the view and the model and it communicates
  with both of them. The view needs to display the data. Therefore, it needs to read the model. It does not
  need to make changes to the model so this communication is one-way.
  For example, the text editor (in this chapter we won't go into implementation details, but this is a good
  example) has a data model called the 'document'. In this model, text is stored, which is broken up into
  lines. We use edit actions to change this text and a Control (in Windows Forms terms) to display our text.
  The Control that displays the text represents the view in our MVC model. The edit actions correspond
  to the controller (even if they are implemented using more than one class) and the model is
  implemented by the document layer. The edit actions see to it that the view is updated and even call for
  redisplay for some actions. The document layer, however, doesn't know anything about the view. All
  these parts are independent of each other. We have tried to apply this model to the whole project.

Design Patterns
The SharpDevelop team decided that the pattern oriented approch in their design.  They also go through the primary design patterns they used as well as go into each with examples and describe the way they were used in SharpDevelop.

Apart from the better structure and enhanced flexibility that the pattern-oriented approach provides to
SharpDevelop, we found design patterns useful for better understanding of the structure, without having
to use UML. However, note that design patterns do not replace UML. In fact, they complement each
other well. UML is important for understanding complex systems but in case the UML diagrams are
missing, patterns make life a bit easier.

Design and Refactoring
Oh how I love refactoring.  Yes, I'm serious I truly enjoy this piece of the development process.  Refactoring is not new but here they discuss what trials they faced and what guidelines they used when it came to refactoring.  This is a good section and I've learned a lot from it.

  • If you don't understand a method, break it down into smaller ones relevant names.
  • Favor readable/understandable code over code with more performance.
  • Don't design too much today; tomorrow it will be so much easier.
  • No amount of refactoring is too much.
  • Use Assertions wherever possible.
  • Solve each problem at its root.
  • Last but not least an important rule: Eat your own dog food.

The point is that, whenever we felt that we had taken the wrong  approach we simply restructured our design, even if it meant we had to restructure a large part project. It is not as much work as it first seems to be and in the long run it helped us a lot and didn't even hurt anybody (not even Clownfish, which is our mascot). Sometimes, because of refactoring, we had to remove a feature from SharpDevelop, but it always re-implemented again later in much better quality and in less time. Some parts were structured whiteboard; some parts have evolved from first tries. But every part has needed refactoring.

So this concludes my highlights of Dissecting a C# Application: Inside SharpDevelop.  Its a free download from APress books so if you are like me and interested in the ins-and-outs of a full blown C# application then this would be a good read.  Like I mentioned before I really only read chapter two because that's what interested me most about the book.

Tags:

Been a while

by Erik Lane 17. February 2006 07:55

I feel bad that I'm not posted anything for a couple of weeks.  I've got something on my mind that I'm going to post about here soon.  I've been working on a side project in the evenings to integrate Plug 'N Pay payment gateway into Storefront.net shopping cart.  That's why I posted about Updating VS.NET.  It wasn't a humdinger of a project but it was cool and my first taste of the VB.NET kool-aide (that's a post in itself).

Anywho, if that interests you in the least then stay tuned.

What does Deophobic mean?

by Erik Lane 1. February 2006 19:06

Listening to the song Savior by Skillet I heard the phrase "redefine your deophobic mind".  I've heard it before but I guess tonight it hit me for some reason.  I went to webster.com and nothing is there.  Went to Wikipedia and nothing was there.  Hrm..what does "deophobic" mean.  Google produced an interview from May of 2004 with Skillet front man John Cooper:

Kim - Honestly John, how many people know what deophobic means?

John - Well, deophobic's not actually a word. I just made that up.

Kim - Exactly.

John - But again, you kind of look into it and think about it. I mean, I think when you think about deophobic means, you kind of put the ideas together and it kind of makes sense. But again, that's not really the point of what we're doing. Coming back to Jesus - honestly - how many people understood Him when He said "If you don't hate your father and mother you can't be called my disciple. You're not worthy"? I mean that's kind of my take on it. I just think that it's coming down to what we have decided that Christianity is supposed to be instead of what the Bible has decided.

Number two on the Google list is deophobic.com.  They define it as "The Fear of Faith in God".  I guess this would be the closest thing to a dictionary definition.  Its from the words phobic and deity.

deity
1 a : the rank or essential nature of a God.

phobic
1 a : having an intolerance or aversion for.

That sounds pretty good to me.  However, when I hear it and think it over I see it from another perspective - the one that I think most deal with that have a fear of faith in God - the fear that they are human and can't look to themselves for all of the answers.  Coming to the grips with the reality that we must humble ourselves before God, ask his forgiveness, and follow Him.  This is not our nature and it scares the bejesus out of us!  I remember it did me.  So what do you do now?  Ask someone you know and talk about it.  Don't know anyone?  Contact me.  We all start our walk somewhere.  What matters is that it starts.

God Bless.

Tags:

Updating VS.NET

by Erik Lane 1. February 2006 05:59

When updating Microsoft Software be sure to use the same version AND source as the original install.

Last night I was "forced" to install VB.NET to go through some sample code I had.  I've been able to translate smaller pieces to C# but this was a full project that I wanted to make some changes to and get it to compile and work on its own.  This isn't going to be a VB.NET  vs. C# post I promise.

Why can I not update a piece of software as long as its the same brand/version/etc..?  All I wanted to do was update my current installation.  I had the CD's on-hand so no problem right?  It would've been if I had remembered that I had installed the Enterprise Architect version and not Professional; which is the set I had on-hand.  So off to subscriber downloads I go to get the correct version.  No issue here, I understand the need for the correct version.

After downloading and burning the images I'm ready to roll?  Negative ghost rider.  This time it was expecting the DVD version since I had installed it using the DVD's in the office.  It even told me I could browse to the MSI package if the original source wasn't available.  I did what they suggested and still no dice.

At this point I'm remembering back when I had something similar happen with MS Office where I just ended up uninstalling and reinstalling the whole thing.  Office is a quicker install than VS.NET so I wanted to avoid that whole scene.  Next step was to download the full install version and pray that it doesn't need to be burned to a DVD as I don't have a DVD burner readily available.  That was the ticket!  Turns out that I didn't have to burn it to DVD and it let me use the MSI package that I pointed it to.

To recap for those not following along:  When updating Microsoft Software be sure to use the same version AND source as the original install.

Tags: