all InfoSec news
@New
May 18, 2024, 6:27 p.m. | Mustafa Çam
DEV Community dev.to
@Named(value = "newtuto")
@ApplicationScoped
public class _04_New {
//üretilen
@Produces
public String uretilenData( @New StudentDto studentDto){
studentDto=StudentDto.builder()
.studentId(0L).studentName("student Adi")
.build();
return studentDto.getStudentName();
}
@Getter
@Inject
private String tuketilenData;
}
Bu Java kodu, CDI (Contexts and Dependency Injection) ve Lombok kütüphanesini kullanarak bir sınıf tanımlıyor. Açıklamalarıyla birlikte her bir parçanın ne işe yaradığını inceleyelim:
@Named(value = "newtuto"): Bu annotation, CDI tarafından yönetilen bir bean'i tanımlar ve newtuto adı altında JSF (JavaServer Faces) gibi view teknolojilerinde kullanılabilir hale getirir¹⁵.
@ApplicationScoped: Bu annotation, …
build builder class dependency inject injection java private public return student value
More from dev.to / DEV Community
Jobs in InfoSec / Cybersecurity
CyberSOC Technical Lead
@ Integrity360 | Sandyford, Dublin, Ireland
Cyber Security Strategy Consultant
@ Capco | New York City
Cyber Security Senior Consultant
@ Capco | Chicago, IL
Sr. Product Manager
@ MixMode | Remote, US
Security Compliance Strategist
@ Grab | Petaling Jaya, Malaysia
Cloud Security Architect, Lead
@ Booz Allen Hamilton | USA, VA, McLean (1500 Tysons McLean Dr)