Daily using/supporting

Get Firefox browser!
Get Thunderbird!
Get Opera browser!
Get The Gimp!
Get Inkscape!
Get LibreOffice!
Get Videolan!
Get Linux!
Get Mandriva!
Get Joomla!
Hacker Emblem

Archives

Which topics would you like us to cover more?

Latest comments

Latest tweets

about 1 day ago Using REDIPS.drag to add drag and drop to your .Net webapplication #li #dib0 http://t.co/n8zY3s7d
about 7 days ago http://t.co/cknQcDbo #Kindle
about 15 days ago Freedom isn't the ability to choose what to do or say, but the ability to choose what not to do or say #freedom
about 29 days ago http://t.co/61KTQknI #Kindle
12 Apr 2012 Force the use of a networking adapter using C# #li #dib0 http://t.co/ZTJOPzOz
9 Apr 2012 Mandriva 2010.2 and USB devices in Virtualbox http://t.co/fwq9gbHB
9 Apr 2012 Execute a http request to you own site with PHP http://t.co/DIvWPrpd
nHapi example
Written by Division by Zero   
Friday, 30 April 2010 14:22

A while ago I wrote a suggestion on how to write an application to support multiple version of HL7 using nHapi. After some questions I received, an example application seems to be helpful. My original post seems to be a little abstract. So here's the example solution I just hacked together. Enjoy! If you have any questions, let me know!

 

Comments  

 
0 # wangang 2010-10-19 09:29
hao dong xi
Reply | Reply with quote | Quote
 
 
0 # Bas 2010-10-21 09:59
Hi,

Thank you for your compliment! :lol:I just translated your comment from Pinyin to English. The translation is "Good thing." (Is that correct?)

Thanks again,

Division by Zero
Reply | Reply with quote | Quote
 
 
0 # Anup 2011-03-12 19:31
Thank you very much !!
Reply | Reply with quote | Quote
 
 
0 # Bas 2011-03-12 21:43
You're welcome! I really hope this example helps!
Reply | Reply with quote | Quote
 
 
+1 # slypete 2012-05-10 19:07
Hello,

Employing .Net dynamics, one can implement a factory without a naive switch implementation. For example:

IMessage message = parser.Parse(message);
dynamic o = Convert.ChangeType(mess age, message.GetType());
PL location = o.PV1.AssignedPatient Location;

The only disadvantage is that you lose compile-time checking, but this approach should drastically reduce boiler plate code.

Cheers,
Pete
Reply | Reply with quote | Quote
 
 
0 # Bas 2012-05-11 11:26
Hi Slypete,

Thank you for your comment. This way will absolutely shorten the code.

There are two reasons that I didn't use .Net dynamics. The first one is that it didn't yet exist at the time (I think... maybe it did and I didn't know about it at the time). The second one is that this code is an example. Statements like dynamic sure are code optimizations. On the other hand they make the code far less comprehensible for less experienced developers. In my opinion it is better to have more code that is better readable than to have less code that isn't.

Of course if an experienced developer would take this example. .Net dynamics will shorten the code and, therefore, make it easier to maintain.

Thanks,

Division by Zero
Reply | Reply with quote | Quote
 

Add comment


Security code
Refresh

Only put off until tomorrow what you are willing to die having left undone. - Pablo Picasso


© 2009 - 2012, Division by Zero

Template based on the empire template by joomlashack 

Valid XHTML 1.0 Strict  Valid CSS!  Creative Commons License
This work by Division by Zero is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License.