Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7854865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:12:54+00:00 2026-06-02T20:12:54+00:00

I am working on a complex enterprise application coded in java that is driven

  • 0

I am working on a complex enterprise application coded in java that is driven by complex object compositions. For example : In a particular scenario, to perform an action this is the flow:

login() -> 
Followed by defined sequence of 10 to 20 method calls in different classes -> 
Followed by a logout()

Within the framework, almost all the actions including the login, logout, and many of the 10 to 20 method calls have no return types. Any erroneous behavior is handled by the framework. Say, in login

public void login(){
try{
 //login actions
 //chained sequence of calls

}catch(){
 // framework handling exceptions and other rollback options
}
}

The intermediate 10 to 20 actions are method calls on different objects at different levels of hierarchy of the framework.

A random class would look like this :

class someobject{

def variable

void action1(){ do something on variable }
void action2(){ do something on variable }
...
}

The variable changes state often and these actions have a sequence defined only by the framework which I find very annoying.

I’d say, Probably if there were appropriate return types at all or at least some of these methods, as in say boolean in the case of login(), life would be a lot easier. Because of this tight adherence to a series of void returning functions, I find it difficult to debug through to understand the flow and also unit testing became a nightmare to me.

So now, I am under the impression that it is always better to write functions that return something, especially when there is a chain of actions involved. So, Is this a safe presumption? I’d want to take your opinions on this. Do correct me if I am wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:12:56+00:00Added an answer on June 2, 2026 at 8:12 pm

    The most basis testability of a method is via its return code. In the case of login you need (as you noted) to be able to test whether you are now logged in, and a boolean return is the obvious way. Otherwise you have to check some property, which seems unnecessarily non-atomic and complex (though might be needed for other reasons).

    To me, this argument extends to any meaningful method. Using void return codes is pretty common but more as a result of old habits than for good design reasons. Simple property setters are a counter-example though, and I am sure there are others.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Debugging a complex jQuery-based application that wasn't working in Opera browser, I traced back
I'm working on a fairly complex Android application that requires a somewhat large amount
I'm working with a multitier SOA based enterprise application with every complex business logics.
I recently started working on a large complex application, and I've just been assigned
I'm working on my first very complex JQuery based application. A single web page
I am working on a relatively complex JavaScript-driven website. It runs great in all
I'm working on a pretty complex web application in Ext with Google maps API
I'm working on a complex application, and I'm having an issue with a listbox
I'm working on Carnatic music scores that involve complex time signatures, that will require
I am working with a complex library that, for historical reasons, is separated into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.