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 ….

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.

Do we need code review?

What is the code review? Simple as its name: Do the review after coding done of a project, feature or just a task. At my company, Catglobe Vietnam, we usually do that, and it is a MUST. PM or TL will do that job.

I was surprised once i asked my friends: How was that going in your company? Got the same answer: No we did not do that stuffs. The first thought came up in my head was that the company is an outsourcing and they do not care much about the quality of code, just passing test is enough to hand over to the client. However, not only that kind of company; company owned the code, call code base, also does the same thing.

How can they build up a good software without reviewing the quality of code, coding style,… ? Being asked that question, they said that: out of resource.

I wonder how many companies really take  care of code review while developing???

Maybe an idea of a code review company ….

VS – No template found

To activate the ability of Windows Workflow Foundation project supported i ran the script, as mentioned in previous post. However, it caused another problem. When i created a new project, VS said there was no templates found. The nice thing was that it came up with an instruction: look at the event viewer of the system.

Yeah, really nice VS, You need to run this line in Command Promp of VS:

devenv.exe /installvstemplates

Reopen the VS and continue your work.