Author Archives: seung

Java could be a pain to C# developers (Pass by Reference)

In C++ and C#, developers have freedom to modify variables by directly having access to memory location.
In C++,
#include <stdio.h>
void swapnum(int &i, int &j)
{
int temp = i;
i = j;
j = temp;
}

int main(void)
{
int a [...]

Posted in General, How To Guide | Tagged , | Leave a comment

Pass by reference

In C++ and C#, developers have freedom to modify variables by directly having access to memory location.
In C++,
#include <stdio.h>
void swapnum(int &i, int &j) {
int temp = i;
i = j;
j = temp;
}
int main(void) {
int a = 10;
int b = 20;
swapnum(a, b);
printf(“A is %d and B is %d\n”, a, b);
return 0;
}
In C#,
int a = 1;
modify(ref a); //now [...]

Posted in Enterprise Java | Tagged , , | 2 Comments

Cache as a cross-cutting concern

I have been recently asked to look into the cache feature within Springmodule in Java community.
Since my current project utilizes spring and aop, I thought it would be a great idea to utilize AOP to cache data.
I actually wrote a prototype file and it was a very rudimentary yet working prototype.  However, I soon realized [...]

Posted in Enterprise .NET, Enterprise Java | Tagged , , , , , | Leave a comment

Cache as a cross-cutting concern

I have been recently asked to look into the cache feature within Springmodule in Java community.
Since my current project utilizes spring and aop, I thought it would be a great idea to utilize AOP to cache data.
I actually wrote a prototype file and it was a very rudimentary yet working prototype. However, I soon realized [...]

Posted in .NET Framework, General | Tagged , , , , , | Leave a comment

Hibernate: Merge vs SaveOrUpdate

In my previous and current project, I have run into cases where I needed to save an object to database using hibernate, and from time to time, I run into some sort of Hibernate Session Exception.
 I did a bit of google search, and it turns out that when saving an object, I needed to make [...]

Posted in Enterprise Java | Tagged , , | 1 Comment

Process vs Thread

Yesterday, Google launched their first web browser application, named Chrome.
http://www.google.com/chrome
And here’s an interesting cartoon that describes Google’s take on web browser.
http://www.google.com/googlebooks/chrome/
What’s interesting is the idea of Process vs Thread.
Google’s Chrome uses Process for individual window, tab, and even plug-in.
In contrast, Firefox, the popular open source web browser, utilizes multiple threads for managing its windows, tabs [...]

Posted in General | Leave a comment

Uploading file: the .NET MVC way

In ASP.NET, the traditional way of uploading files is as follows.

<form id=”form1″ runat=”server”>
<asp:FileUpload ID=”FileUpload1″ runat=”server” />
<p>
<asp:Button ID=”Button1″ runat=”server” Text=”Upload”
OnClick=”Button1_Click” /></p>
<p>
<asp:Label ID=”Label1″ runat=”server”></asp:Label></p>
</form>
And you have access to the uploaded [...]

Posted in .NET Framework | Tagged , , | Leave a comment