Javabean ituh just a convention...

But a very unique one at that... :p

Kalo liat di web nya sun (baca:oracle)... katanya java bean ituh plain old java 
object...

Yang... harus punya constructor with no parameter, 

dan beberapa naming convention of how the getter and setter method should be 
named...

and nothing else...

Kenapa begini?

Banyak framework... (spring yang udah gue bongkar... dan banyak pake ini... )

Yang pake code macem gini nih...

Contoh concrete mungkin lebih kena yah...

class Student {

    private String name;

    //getter and setter

}

 

Ntar di pake dengan cara gini nih...

 

BeanWeapper student = BeanWrapperImpl(new Student()):

student.setPropertyValue("name", "Adelwin");

 

nah.. kliatan khan gunanya?

Dan kenapa convention ini dipake banget?

 

Jadi... class tersebut.. BUKAN javabean...

 

Adelwin Handoyo  |  Senior Consultant - Wholesale Bank
Standard Chartered Bank
Plaza By The Park #06-00, 51 Bras Basah Road. Singapore (189554)
T : (65) 655 72441  | E adelwin.adel...@sc.com 

 

 

________________________________

From: jug-indonesia@yahoogroups.com [mailto:jug-indone...@yahoogroups.com] On 
Behalf Of Niksen Harjanto
Sent: Tuesday, February 09, 2010 9:07 PM
To: jug-indonesia@yahoogroups.com
Subject: Beda Class Sama JavaBean - WAS : (Re: [JUG-Indonesia] Re: Membuat 
Koneksi Java Mysql dari textfield)

 

  

>
> Buat kelas MySQL kira-kira seperti ini:
>
> class MySQL{
> private String host;
> private int port;
> private String username;
> private String password;
> private String URL;
>
> MySQL(String host, int port, String username, String password){}
> MySQL(String URL){}
>
> public String toString(){return URL;}
> }
>

apa sih bedanya class di atas sama javabean? Kalo baca di buku java
bean kok bentuknya kaya di atas, cuma bedanya di java bean semua
variable private dibuat getter setternya....

nubie nih di jetu e e




This email and any attachments are confidential and may also be privileged.  If 
you are not the addressee, do not disclose, copy, circulate or in any other way 
use or rely on the information contained in this email or any attachments.  If 
received in error, notify the sender immediately and delete this email and any 
attachments from your system.  Emails cannot be guaranteed to be secure or 
error free as the message and any attachments could be intercepted, corrupted, 
lost, delayed, incomplete or amended.  Standard Chartered PLC and its 
subsidiaries do not accept liability for damage caused by this email or any 
attachments and may monitor email traffic.

 

Standard Chartered PLC is incorporated in England with limited liability under 
company number 966425 and has its registered office at 1 Aldermanbury Square, 
London, EC2V 7SB.

 

Standard Chartered Bank ("SCB") is incorporated in England with limited 
liability by Royal Charter 1853, under reference ZC18.  The Principal Office of 
SCB is situated in England at 1 Aldermanbury Square, London EC2V 7SB. In the 
United Kingdom, SCB is authorised and regulated by the Financial Services 
Authority under FSA register number 114276.

 

If you are receiving this email from SCB outside the UK, please click 
http://www.standardchartered.com/global/email_disclaimer.html to refer to the 
information on other jurisdictions.

Kirim email ke