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 6144017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:35:42+00:00 2026-05-23T18:35:42+00:00

I am building an application on two layer. Web layer and business layer. Inside

  • 0

I am building an application on two layer. Web layer and business layer.

Inside the business layer I have some public method that can be called within the business layer or from the web layer.

I only want some of these methods being called from the web layer (the safe one).

I was wondering if I can create a annotation in my business layer, for example @Public which means I can call this method from the web layer, and @Private so I should not use this method from the web layer.

And when I try to call a @private method from the web layer (in eclipse) it gives me a warning?

As well: Can I have a way to list automatically all this method private and public?

  • 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-05-23T18:35:43+00:00Added an answer on May 23, 2026 at 6:35 pm

    AFAIK you can’t make Eclipse use annotation to determine whether you can access a method from a certain file. For this to be possible Eclipse would have to know whether the file is part of the web layer or the business layer.

    In order to list all methods having a certain annotation, you could use reflection at runtime. In Eclipse there might be filters, but I don’t know of any annotation based filters.

    Maybe you should choose another approach, I’ll shortly describe how we do that:

    We have two interfaces that our services may implement:

    • one public interface that contains all the methods the web layer may see
    • one private interface that contains all the methods internal to the business logic

    We split those interfaces into two eclipse projects – one public api project and one implementation project that contains the services and internal api – and just allow access to the public api project from the web layer.

    Since our services (EJB 3.0) need an interface, we have to add the internal one, if we have internal methods. However, with other technology (like EJB 3.1) you might also just provide the public interface.

    Another approach might be to split the interfaces into two packages, e.g. myproject.api.pub (public is a keyword) and myproject.api.internal, and then use package based filters in Eclipse.

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

Sidebar

Related Questions

I am building a web application using ASP.NET MVC that has two very distinct
I have a small web application that I am building. Primarily to improve my
I have a J2EE application which has two web.xml files. One is called web.live.xml
I'm building an application that will have two different types of users, lets call
I'm building a generic web application for two business groups. The logo/banner needs to
I'm slowly building my application to a working state. I'm using two functions called
I'm building a utility application that synchronizes files across two systems for Mac OSX.
I am building application that required some data from iPhone's Call log(read only). The
I'm building a simple web application that handles a simple database using struts and
I'm building a Qt application that have about 30 different views (QWidgets). My idea

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.