18
Mar 11

Ternary operator in VB.net

For about months ago I started working in a amazing company in Norway called OMEGA as Application Developer / Systems Engineer.

VB.net (winforms) is one of the platforms we use.

Since I come mainly from the world of Java, PHP and ActionScript, It’s been a constant learning process in which it is impossible not to compare features among technologies.

Today I was wondering how do the ternary conditional operator works in VB. I remember I use the “?:” operator in Java in Order to assign the value to a variable according to the result of a conditional operator.

This is what I found:

Java:

String resultMsg =  MyVar1 == MyVar2?"The Variables are equal":"The variables are NOT equal";

VB.Net

Dim resultMsg as String = IF(MyVar1 = MyVar2, "The Variables are equal","The variables are NOT equal")

Best!


04
Mar 11

Modeling Data

Prerequisites:
– Some understanding of software engineering and Databases.

They ask me at work if I could find open source tools to create database diagrams.

But, which types of diagrams are we talking about? They are different approach for data modeling. Some could start thinking immediately on tables and relationships between those tables; others will instead start thinking any sort of business logic model and others will start thinking objects and entities (classes).

First, it is important to point that there are some differences in modeling for databases and for programing (assuming object oriented programming). You most likely have heard about UML (Unified Modeling Language); Some people may immediately associate this term to class models. However, UML define a more complete modeling language for software engineering; which includes diverse types of diagrams to represent structure, behavior and interaction.

UML Diagrams

UML Daigrams

Commonly, when it comes to databases, modelers point to relational models. Despite the fact the they must exist different names to call this type of models, I will just call them Relational Database Diagrams. The truth is that I ask around my colleges and all of them understand which type of diagrams I was referring to, but we didn’t named it the same at first time. normally a database diagram will have database table definitions. Basically, tables with columns and references between some of them. However there is more potential in this type of modeling. If you expend some more time in your database models defining column’s data types, foreign key constraints, Primary keys, check constrains for columns, etc… you will probably expend less time in development since you will detect problems in the designing stage on your project (much better here than in development and definitely much better that in testing and production). Other advantage of implementing this definitions is that if your client has some understanding of relational databases and if you has the opportunity to write Relational Database Diagrams together, the probability of having better quality requirements will increase and consequently, The designing and developing time will decrease.

At Omega we use mainly Microsoft SQL Server as our relational database management system (RDBMS). It provides a interesting tool to create Relational Databases Diagrams. however we wanted to explore the features of other open sources tools.

Interesting tools I founded:

  • Oracle SQL Developer Data Modeler:Even though this tool is designed but no limited to Oracle as RDBMS, it is a very complete and easy to use tool. Some of the key features are:
    • Creation of tables with columns with well defined data types
    • Constrain definitions (foreign key and check constrains.
    • Logical Modeling
    • Multidimensional Models
    • Relational Models
    • Pre-Defined Data, user defined data types and the option of mapping Oracle data types to other RDBMS data types
    • Allows to include Business information Data, this could be especially useful when working with requirements elicitation
    • Process Modeling, including among others: Data flow diagrams, information structures, Events and Roles
  • DB Designer:What I loved the most with this tool was its simplicity and potential, some of the Key features are:
    • Very simple to use and a clean interface
    • Creation of tables with columns with well defined data types
    • Constrain definitions (foreign key and check constrains.
    • Defined Data types and the possibility of creating new data types
    • The option to open data from a RDBMS

They are for sure much more solutions, but for the time I expended, those two were the ones that I would like to high light.

I hope this could be useful for someone.

Enjoy your weekend!