0

I want to use Spring Data Cassandra in a non-Spring Project for Object Mapping. The project is not using Spring Boot or any other Spring component. Is this a good practice or I am doing it the wrong way?

P.S-Things are working fine but just wanna know If I'm on right track.

HyperX Pro
  • 158
  • 2
  • 9
  • It's possible but it can be a headache, especially if you're using OSGI for plug-ins. This could be helpful; https://stackoverflow.com/questions/23974249/spring-data-jpa-without-spring-boot – Jason Jul 30 '20 at 18:35
  • I am just initializing CassandraTemplate(CqlSession) for interacting with Database and annotations for mapping my object retrieved back and forth from Database. Very simple code and minimalistic. Just don't know if it's good practice to use Spring Data in Non-Spring Project. – HyperX Pro Jul 30 '20 at 18:38

1 Answers1

1

The usage of Spring Data in a non Spring project is frequent (mostly in old projects). The real question is, how to integrate it properly in your current architecture. It's not a good or bad practice, it's a technical chose which must be in adequacy with your functional and technical requirements.

Victor
  • 61
  • 4
  • I do agree with you but the reason behind not using Spring Boot or making my project Spring centric is, I never felt the need to do so. Everything just works fine normally. Spring Data for Cassandra is definitely a need because it was the simplest object mapper I found for Java that supports Cassandra. – HyperX Pro Jul 30 '20 at 19:28
  • 1
    I think it's a good way. The usage of Spring Boot it's absolutely not a requirement, we use it at the beginning of a project for start it quickly and facility the Spring configuration, it's not your case. So your choice it's totally legitimate. – Victor Jul 30 '20 at 19:56