0% found this document useful (0 votes)
2 views2 pages

Java MVC Example for Student Management

Uploaded by

7692003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Java MVC Example for Student Management

Uploaded by

7692003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Ogrenci.

java
----------------------------------------------
package mvc_pattern1;

public class Ogrenci {


private String ogrenciNo;
private String ad;

public String getOgrenciNo() {


return ogrenciNo;
}

public void setOgrenciNo(String oNo) {


[Link] = oNo;
}

public String getAd() {


return ad;
}

public void setAd(String ad) {


[Link] = ad;
}

}
----------------------------------------------

[Link]
----------------------------------------------
package mvc_pattern1;

public class OgrenciView {


public void printOgrenciDetails(String ogrenciAdi, String ogrenciNo){
[Link]("��renci: ");
[Link]("Ad�: " + ogrenciAdi);
[Link]("Numaras�: " + ogrenciNo);
}
}
----------------------------------------------

[Link]
----------------------------------------------
package mvc_pattern1;

public class OgrenciController {


private Ogrenci model;
private OgrenciView view;

public OgrenciController(Ogrenci model, OgrenciView view){


[Link] = model;
[Link] = view;
}

public void setOgrenciAd(String ad){


[Link](ad);
}

public String getOgrenciAd(){


return [Link]();
}

public void setOgrenciNo(String oNo){


[Link](oNo);
}

public String getOgrenciNo(){


return [Link]();
}

public void updateView(){


[Link]([Link](), [Link]());
}
}
----------------------------------------------

[Link]
----------------------------------------------
package mvc_pattern1;

public class MVCPatternDemo {


public static void main(String[] args) {

//veritaban�ndan ogrenci numaras�na g�re ��renci kayd� getir


Ogrenci model = retriveOgrenciFromDatabase();

//view yarat: ��renci detaylar�n� console a yazmak i�in


OgrenciView view = new OgrenciView();

OgrenciController controller = new OgrenciController(model, view);

[Link]();

//g�ncelle model datay�


[Link]("Ogrenci2(model'i view ile g�ncelle)");

[Link]();
}

private static Ogrenci retriveOgrenciFromDatabase(){


Ogrenci ogrenci = new Ogrenci();
[Link]("Ogrenci1(model)");
[Link]("15");
return ogrenci;
}
}
----------------------------------------------

You might also like