have fun with SQL and Excel

I have been programming for more than 3 years, of course exclude the university time. Most of the time, i work with web development based on C#, ASP.NET with SQL Server. However, honestly speaking, i am not good at SQL. I just work with basic functionalities which are required to make CRUD operations.

One day, my boss gave me a task which required me to look at closely at SQL database and excel. And they were not my fields at that time, especially excel 🙁

After a couple of weeks working with requirements, i am not talking detail about the logic of task here, with the help of my boss, i have had those new things for myself, not really new for you 🙂

In summary, my task was: extract data from SQL database and format into excel file and then finally import that excel file into a new system. And the original data was not well organized and correct.

To do the extracting, i made a small window app. But the difficult thing was checking the data. Here are my steps:

  1. We have many ways to import data into SQL server. Here i work with Excel. So i import data from excel into SQL.
  2. After importing data in excel, you can customize it and make some query to get the data back
  3. Then do copy and paste the data into excel again.
  4. Make graph or any calculations to check the data again what you had so far.

The point here is that, after doing this task, i like to work with SQL and Excel more than ever. They are really nice tools.

wcf – endpoint basic

I have just finished reading about WCF – Service Endpoint basics. So what is it?

Endpoint is where consumer contacts with service. To remember about endpoint, just need to remember this: ABC of endpoint, stand for: Address, Binding, and Contract.

  1. Address: The URL of the service location: http://localhost/SomeService/Service/
  2. Binding: Define how to access the service, how to communicate with service.
  3. Contract: Define what service does

There are 2 ways of creating endpoint: by configuration and by code. Should use configuration as best practice. Since you can change it later point of time when the service is deployed without recompile the code.

Creating endpoint using configuration is quite simple. Just create a wcf library project then VS takes care of all stuffs for you 🙂

For services exposed to multiple clients, you can specify more than one endpoints so client can use the one most suitable for them. You add one more endpoint tag in configuration and make sure that the address is unique for each. If the address is the same, then the contract should be different.

Take advantage of baseAddress tag to specify the common part of the address. And again, VS already takes care of that 🙂

The default configuration generated by VS exposes meta data to the client. To turn it off set the httpGetEnabled to false.

I just wrote them down here as a way of learning it, if you do not understand or have any question, please post a comment.

WCF – Contracts

This is the first time i spend time to read about WCF, even thought it has been there for long time. And i have just finished chapter 1 🙂 . With the OOP in mind, since i have been working with OOP quite long enough, i got surprised with the advise from the book:

DO NOT THINK IN OOP WAY, IN DOCUMENT INSTEAD.

So what are behind the scene here? WCF is SOA ( Service Oriented Architect), everything is seen as contract and message. Whereas, OOP is the way we build our object model to solve the business needs.

Summary of some keys word:

  • To define a service: Mark interface with ServiceContract attribute, always remember to give it a Name and Namesapce as best practice.
  • To define a function: Mark the function with OperationContract, in case of throwing exception, an FaultException object, then FaultContract attribute is require. Remember that never use this property for OneWay operation.
  • To define a class containing data sent through the service: Mark class/enum with DataContract attribute, mark each member to be serialized with DataMember or EnumMember

In case of you really need to make an inheritance and the return type is for base class, for instance, Task class. And you have a class ApprovalTask inherited from Task. Consider the situation you want to return a collection of Task, and there are some ApprovalTask. THEN, the Task class must be decorated with KnowType(typeof(ApprovalTask)) attribute.

Continue reading ….

Working with customer

I am not really a freelancer or finding some projects outside. However sometimes i have got some requests from my friends or relatives. Usually they’ve come up with simple idea: asking me to build a website for them. Discussing some core features and then asked me for a price. How can i point out a price with just a bit detail? Yeah i was put in a hole. I wrote them out a bit clearer and then told them a cost for those.

Wow simple as it was. However, here were the customer characteristics came in. They said: OK we forget the price sine it is done. You know what’s next? They slowly came up with new small things, extension of the big picture before.

The devil came to play here. I was not working in contract with them, just in relationship. How can you refuse just a little thing. A little thing, a little thing, …. and then you got a BIG thing 🙁

The day tomorrow, they sent me an email telling all what they wanted, of course, the same price. I could not say a word, well shorted order of more than 10 features. Of course, i sent them what we all agreed the previous day. Surely i got some excuses from them. However i knew the truth behind that scene.

Price and quality go together. They know that, but in negotiation, they try to ignore the quality first, do not mention about it to get a lower price. When the price is fixed, yeah quality comes to play.

BE CAREFUL WITH CUSTOMER NO MATTER WHO THEY ARE

First thoughts about 70-536

I have been more than 3 years after school in software development, major in web development. Most of the time dealing with business logic. And i have been reading lots of articles, books about TDD, DDD, Design Pattern and other programming methodologies.

It has been good as it has since nowadays we are dealing with solving the business needs and logic.

And one day, i decided to start training kits from MS to get MCTS certificate. Getting into the book designed for foundation knowledge i was so surprised: Too many things i really do not know, or aware of.

Here are some thoughts about reading it:

Firstly, reading that book is quite interesting and useful. However to remember them is not an easy task. It reminds me the time of being at high school 🙂 And, of course, there are some chapters i am not interested in like: Graphics, Installing and Configuring Applications, … Why? How often will i use them?

Secondly, It makes me confuse of what i should focus on. Not exactly that but quite pretty much. The thing is that i am lacking of real practical reason of remembering them. Whereas i can google for it.

Btw, i am going to finish the very first exam. So, any advices please let me know.