• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

@Profile() annotation vs @JSonAlias

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1108
19
Mac OS X IntelliJ IDE Oracle Spring VI Editor Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Peter you are right. It is about putting common business logic into small reusable POJO's?    
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic