Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

@Profile() annotation vs @JSonAlias

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is a good pratice to have multiple POJOs with @profile to support multiple incoming response or it would be the best practice to use @JsonAlias to support multiple incoming response

I would like to understand when to use @Profile and when we should go for @JSonAlias

Thanks.
 
Bartender
Posts: 1049
19
Mac OS X IntelliJ IDE Oracle Spring VI Editor Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are these two annotations related in any way?  I'm really not familiar with @JSonAlias but after a quick web search it appears to be a way of using different names for attributes when deserialising JSON data.

@JsonAlias annotation (since version 2.9) can be used to define one or more alternative names for a property which should be mapped during deserialisation.



In spring the @Profile annotation is used within Java configuration to include [inject] POJO's for different configuration(s) in order to facilitate testing.  Typically you would have different sets of configuration for different environments.  Typically this could be for development, integration testing, UAT/OAT, and live environments.    

Not really sure what technology you are using "multiple incoming response"?  Would it not be better to just deal with each type of request/response individually, putting common business logic into small reusable POJO's?    
 
Joseph Michael
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Peter you are right. It is about putting common business logic into small reusable POJO's?    
 
Right! We're on it! Let's get to work tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!