0

I am currently working on a login system for a site using the Zend Framework for its MVC architecture.

Which design makes more sense

  • registration and login each gets its own set of model, views and controllers.

  • both the registration and login is implemented within the same model, view and controller.

Would love to hear the arguments for and against both design patterns so i can better understand the "preferred" or "best" way to implement a program using the MVC architecture.

1 Answer 1

3

I think separate controllers and views should be used for Login(Authentication) and Registration but same database Model, DbTable and Mapper classes can be used for both.

For Example:

Login Controller:

index action (Show login form)
process action (Process login form)

Access URL: projectname.com/login

Registration Controller:

index action (Show registration form)
process action (Process registration form)

Access URL: projectname.com/registration

BUT same:

Model class
Mapper class
DbTable class
Sign up to request clarification or add additional context in comments.

4 Comments

What exactly does the mapper class do? So far, i have completed the registration portion of the code, and did not use this Mapper class. The Zend documentation isn't very clear about it as well.
Please review the tutorial here: framework.zend.com/manual/en/…
Mapper class is used to contact with database. It contains functions like find(), save(), and fetchAll().
Thank you, that is a great help indeed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.