Announcement Announcement Module
Collapse
No announcement yet.
Dependany Injection Questions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dependany Injection Questions

    Hi All,

    I have used Itext to create a POC for my client to generate some dynamic PDFs. I would now like to incorporate the functionality into a mvc webbapp and would like some advise with the config/wiring of the app and dependency injection.

    I basically have three types of PDFs in a inheritance tree - NewPdf, RenewPdf and CancellationPdf.
    The web page will contain links that generates each type of PDF.

    What would be the correct way to wire this in my controllers.

    1) Do I inject all three Pdf objects (NewPdf, RenewPdf and CancellationPdf) into controller using Autowired?
    2) Should I have a separate controller for each flavour of PDF and inject the relevant PDF object?
    3) Should I have a controller that creates the PDF depending on what the user selects. (I see this as tightly coupling objects to my controller which is not the correct way of doing things? )

    I really want to do this correctly and any help would be great.

    Thanks
Working...
X