Skip to main content

Posts

Showing posts from June, 2012

Cohesion and coupling, what are they? And why is one good and the other bad?

Coupling and Cohesion are the two terms which very frequently occur together. Together they talk about the quality a module should have You might have got this advice n number of times that " cohesion is good and coupling is bad ", without actually going into the details as to what they mean and why one of them is bad and why the other one is good. Maybe because the one who is advising is not aware himself of the details and the one who is getting the advice is hesitant enough to ask, or may be they are not able to give good explanation. So in this post I am trying to give a good explanation on both, and hopefully good examples which you can co-relate with incidents and things in your daily life. As usual, lets start with checking what Wikipedia has to say on this On Coupling "In software engineering, coupling or dependency is the degree to which each program module relies on each one of the other modules." On Cohesion "Cohesion is a measur

MySQL - What should I use varchar, char, text or blob and when?

MySQL datatypes We all might have gone through the confusion of choosing among the different string related datatypes for data storage, and so have I, many a times. Thus here I have compiled all the info that I had, got and could gather into a single post so as to give a better understanding of things which need to be factored while much such critical decisions. As we all are aware that the following are the string data-types that are supported by MySQL CHAR   VARCHAR   BINARY   VARBINARY   BLOB   TEXT   ENUM   and SET .  Just for your reference I have put hyperlinks for the corresponding  mysql manual doc page. I have divided the post into 4 sets, each discussing about the two datatypes, and how to choose between them CHAR/VARCHAR BINARY/VARBINARY BLOB/TEXT ENUM/SET and in section with BLOB and TEXT we discuss about the things should be considered when deciding between all the the first 6 dataypes. We will start with discussing about their basic propeties