ServiceLocator’dan Inversion of Control’e Yolculuk

Harezmi Bilişim Çözümleri olarak 7 seneden fazla bir zamandır Spring Application Framework ile ilgili eğitimler veriyoruz. J2EE’nin ilk dönemlerinde kurumsal Java uygulamaları geliştirilirken kullanılan  ServiceLocator örüntüsünün nasıl IoC veya Dependency Injection’a doğru evrildiğini anlamanın Spring Application Framework’ün özünü ve temel felsefesini anlamak için çok faydalı olduğunu düşündüğümüz için de eğitimelerimizde Spring’i anlatmaya bu konu üzerinden […]

Read More →
Weird Rollback Behavior of Spring TestContext Framework

One of the nice features of TestContext module of Spring Application Framework is its ability to run unit tests within a transaction context. By that way, you are able to both execute your persistence operations which usually expect an active transaction to run, and also rollback state changes occur during execution of these persistence operations […]

Read More →
Spring XML ve Annotation Tabanlı Konfigürasyonlar Birbirinin Aynısı mı?

Yakın bir zamanda Beginning Spring isimli kitabımız üzerinden Spring öğrenmeye çalışan bir arkadaşımdan kitapta okudukları sonrasında kafasında beliren böyle bir soru geldi. Kendisine verdiğim cevap belki Spring ile çalışan veya çalışmaya başlayacak arkadaşların da işine yarayabilir düşüncesi ile buradan paylaşıyorum. Spring ApplicationContext‘e hangi sınıfları kullanarak hangi bean’leri oluşturacağını, bu bean’lerin özelliklerinin neler olacağını, bean’ler arasındaki […]

Read More →
Observations about OData and Spring Data REST

Recently I had a chance to spend some time reading about OData and experiment with Apache OLingo Project in order to understand what OData provides us with in terms of making our REST services more standardized and self discoverable. I also compared it with Spring Data REST Project, what are their similarities and differences, whether […]

Read More →
Factory Method Pattern Implementation of Spring: FactoryBean

Factory method pattern aims to encapsulate object creation process within a separate method in your system. That’s why it is called as so. Factory methods can be created as either static or instance methods within a class. In Spring Application Framework, although it is possible to make use of static or instance factory methods to […]

Read More →
A Slight Difference Between Autowire byType and constructor

Spring documentation states that both autowire byType and constructor modes expect at most one bean definition in the ApplicationContext, so that it can be autowired into the depending bean. Here is the excerpt taken from Spring Reference Documentation Table 6.2. Autowiring modes; byType Allows a property to be autowired if exactly one bean of the […]

Read More →
A Transaction Gotcha When Using Spring with Hibernate

Spring’s transaction propagation rule SUPPORTS states that if there exists a transaction when the method is called, it should work within that transaction, otherwise it should work outside any transaction. Similarly, transaction propagation rule NOT_SUPPORTED states that if there exists any active transaction when the method is called, that active transaction should be suspended before […]

Read More →
What is the difference between Strategy and Template Method patterns…, if there is any?

In our Spring book, we discuss about transaction management mechanisms available in the Spring Framework, namely declarative and programmatic transactions. It is further explained inside programmatic transaction demarcation section, that how programmatic transaction can be achieved using different methods. One of the ways programmatic transaction can be achieved is, using TransactionTemplate utility class provided by […]

Read More →
Spring Ekosisteminde Kurumsal Yazılım Geliştirme

ULAKBİM tarafından düzenlenen Kamuda Açık Kaynak Konferansı‘ında Spring Framework’ü etraflıca tanıttığımız Spring Ekosisteminde Kurumsal Yazılım Geliştirme isimli bir sunum yaptık. Katılım oldukça yoğundu. Sunumu Spring, kurumsal uygulamaların özellikleri ve orta katman ihtiyaçları ile ilgili kısa bir bilgilendirmenin ardından demo ağırlıklı gerçekleştirdik. Harezmi Bilişim Çözümleri olarak düzenlediğimiz “Kurumsal Java Eğitimleri”nde sürekli olarak kullandığımız petclinic örneği üzerinde […]

Read More →
How to Switch from One DB Instance to Another at Runtime

Sometimes we may need to switch from one db instance from another during runtime. Actually this is very easy if you are using Spring and DataSource API in order to obtain DB connections. Lets look at our solution for such a requirement. Our solution lays on “proxy pattern“. Spring provides us with ProxyFactoryBean so that […]

Read More →