× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



But where would you rather place the logic for

validating a login? In the application?

Probably depends on the situation. For example, the login function could
be application specific (i.e. do they have an expired cookie? No? Then
send them to the dashboard. That would be different than a internal user
querying the same tables through WebQuery. I'd put this in the "leaky
abstraction" category). I think the important thing is modularity for
reuse.


Aaron Bartell

On Wed, Nov 5, 2014 at 1:18 PM, Nathan Andelin <nandelin@xxxxxxxxx> wrote:


Unit testing can cover many areas other than just data validation. For
example, a unit test can verify that if an invalid login occurs does the
browser display "invalid login".


Yes, of course the application would need to return an "invalid login"
message to the user. But where would you rather place the logic for
validating a login? In the application?

Or, might the application instead attempt to "record" a login (write to a
database table), then simply return an error message generated by the
database manager? So that validation occurs in the database, so to speak,
rather than in the application.

That way you keep the application logic simple, and let the heavy lifting
so to speak be handled by code which runs on the same server as the
database, and in the same address space as the database.

If you are validating a login against an IBM i user profile, that could be
performed by a "before" trigger too.


Or when a user submits the "forgot my
password" form does the resulting email produce a URL that resolves as
expected.


I'm not sure that I fully understand the use case. But wouldn't the same
principle apply? In other words, place code which implements business rules
such as sending an email to a use; have that run in a software component
that "knows" the user and his email account, because that software
component runs in the same address space as the database?

Again, simplify the module which may be supporting the user interface, by
placing code that queries and maintains the database, within the database,
again using ILE components.

Nathan.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.