Re: [OT] Hiding methods - a final remark

2006-02-20 Thread Laurie Harper
Tom Ziemer wrote: Thanks to everybody who replied to my original post. I am currently using spring/acegi and it's working great - as long as you use Spring to create your beans: // Spring - works like a charm: security via acegi and transactions via proxies this.entityManager = (IEntityManager)

Re: [OT] Hiding methods - a final remark

2006-02-20 Thread Tom Ziemer
Thanks to everybody who replied to my original post. I am currently using spring/acegi and it's working great - as long as you use Spring to create your beans: // Spring - works like a charm: security via acegi and transactions via proxies this.entityManager = (IEntityManager)getBean(SpringBean.M

Re: [OT] Hiding methods

2006-02-17 Thread Laurie Harper
Paul Benedict wrote: Spring can give you method-level security if you're interested in it. http://acegisecurity.org/ It will use AOP to proxy your classes and make sure any thread has the proper credentials to access your code. And that's how to re-invent the wheel in chrome ;-) Seriously, P

Re: [OT] Hiding methods

2006-02-17 Thread Laurie Harper
The Java security manager infrastructure. That's what it's there for :-) L. Frank W. Zammetti wrote: What is so objectionable about it? If you think securing a method is a good idea (I'm not sure I do, but let's assume for the sake of argument), why is this answer "square"? :) I don't doubt

RE: [OT] Hiding methods

2006-02-17 Thread George.Dinwiddie
LOL! Wunnerful! And I agree. > -Original Message- > From: Josh McDonald [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 16, 2006 7:04 PM > To: user@struts.apache.org > Subject: Re: [OT] Hiding methods > > > Strewth! I just went back and read this thread.

Re: [OT] Hiding methods

2006-02-17 Thread Dave Newton
netsql wrote: > Ahh... that's what code defensively means. :-) Programming for job security. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [OT] Hiding methods

2006-02-17 Thread netsql
Ahh... that's what code defensively means. :-) Some threads are just more fun. .V Frank W. Zammetti wrote: What's wrong with the implementation? And, if it took my replacement a week to figure that out, I would hope he'd have a replacement shortly thereafter :) Frank

Re: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
What's wrong with the implementation? And, if it took my replacement a week to figure that out, I would hope he'd have a replacement shortly thereafter :) Frank Josh McDonald wrote: It's not the idea we're objecting to so much as the suggested implementation. But the problem is no matter h

Re: [OT] Hiding methods

2006-02-16 Thread Paul Benedict
Spring can give you method-level security if you're interested in it. http://acegisecurity.org/ It will use AOP to proxy your classes and make sure any thread has the proper credentials to access your code. Paul __ Do You Yahoo!? Tired of spam?

Re: [OT] Hiding methods

2006-02-16 Thread Dave Newton
Josh McDonald wrote: > It's not the idea we're objecting to so much as the suggested > implementation. > > But the problem is no matter how nice your implementation is, you've > still got to maintain a list of "allowed" classes, which is fine for > you. Unfortunately when you've moved interstate,

Re: [OT] Hiding methods

2006-02-16 Thread Josh McDonald
It's not the idea we're objecting to so much as the suggested implementation. But the problem is no matter how nice your implementation is, you've still got to maintain a list of "allowed" classes, which is fine for you. Unfortunately when you've moved interstate, and your replacement's replaceme

Re: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
Because knowing the calling object might not be sufficient... you may want to know the exact method that called, and further, you may not want to introduce the extra parameter, which changes the public interface. Mind you, I AM NOT saying this is a good idea or anything, but I am a little surp

Re: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
What is so objectionable about it? If you think securing a method is a good idea (I'm not sure I do, but let's assume for the sake of argument), why is this answer "square"? :) I don't doubt there is a better answer, but what is it? Frank Laurie Harper wrote: Frank W. Zammetti wrote: I sa

Re: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
Question: How is the basic concept any different from method-level security on an EJB? Aren't you in essence putting security on a public interface? I personally would tend to not block access to method either, by whatever method, as was originally asked about... but is it really as evil as

Re: [OT] Hiding methods

2006-02-16 Thread Josh McDonald
The short of it is you can get around public, private etc with reflection anyway, so why slow down the entire system just because you're under the incorrect assumption you can "force" api consumers to do anything? If it's that flaming important, sick the lawyers on 'em. That's what they're for.

Re: [OT] Hiding methods

2006-02-16 Thread Josh McDonald
Strewth! I just went back and read this thread... Throw an exception and check to see if you like the caller That makes baby jesus cry. If you have public methods you don't want people to call, ask them not to. If doing what you ask them not to causes exceptions and their program not to work,

Re: [OT] Hiding methods

2006-02-16 Thread Paul Benedict
It sounds like it is time you move to the Spring Framework. [1] Do not allow your DAO to manage transactions. [2] Transactions are managed by manager proxies. [3] Transaction Managers are configured to say which methods start a transaction. [4] Transaction Managers are smart enough to know, wi

Re: [OT] Hiding methods

2006-02-16 Thread netsql
Wow. Why not method(args, this); so you know the calling object. or better version. register(this); method(arg); Plenty of OO designs. Or just don't make it public, there are 3 "modifier" choices left other then public, including package/friend. I would just expose an

Re: [OT] Hiding methods

2006-02-16 Thread Laurie Harper
Frank W. Zammetti wrote: I saw a very similar question asked a few months back in a general Java forum, and I suggested an answer that I've never had the chance to actually try out... the theory is interesting though... In the method you want to "protect", immediately throw an exception and catc

RE: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
Just a quick hacked-together test: public class test { public static void main(String[] args) { m1(); } private static void m1() { m2(); } private static void m2() { Throwable t = new Throwable(); t.fillInStackTrace(); StackTraceElement[] ste = t.getStackTrace();

Re: [OT] Hiding methods

2006-02-16 Thread Dave Newton
[EMAIL PROTECTED] wrote: > I don't think you'd have to throw and catch it. I think it's sufficient > to create an instance of Throwable to check the stack trace. > That is correct. Before you could get the array (or whatever it is) of the stack trace we'd 'print' the stack trace to a string th

RE: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
Hey yeah, I think your right! It *still* may be a little heavy, but one would definitely think less so. Off to play for a few minutes... -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED]

RE: [OT] Hiding methods

2006-02-16 Thread George.Dinwiddie
Michael Jouravlev replied > On 2/16/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > > In the method you want to "protect", immediately throw an exception > > and catch it. Then, parse the stack trace and see who the > caller was. > > If it's not a class you want to have access to the method

Re: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
Throwing exceptions has always been a somewhat expensive operation, so certainly where high performance is a concern I wouldn't even think of doing this. But, if it's a handful of especially sensitive methods that aren't called all the time, it might be acceptable. Some quick and easy tests shoul

Re: [OT] Hiding methods

2006-02-16 Thread Michael Jouravlev
On 2/16/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > I saw a very similar question asked a few months back in a general Java > forum, and I suggested an answer that I've never had the chance to > actually try out... the theory is interesting though... > > In the method you want to "protect",

Re: [OT] Hiding methods

2006-02-16 Thread Frank W. Zammetti
I saw a very similar question asked a few months back in a general Java forum, and I suggested an answer that I've never had the chance to actually try out... the theory is interesting though... In the method you want to "protect", immediately throw an exception and catch it. Then, parse the stac

Re: [OT] Hiding methods

2006-02-16 Thread Laurie Harper
Tom Ziemer wrote: Hi, I have got a question quite unrelated to Struts: My app. is pretty much layered, meaning, I have Hibernate, on top of which there are SpringDAOs, on top of which are Managers that represent my business logic. Now I wonder, if it is possible, to *hide* (maybe with annotatio

[OT] Hiding methods

2006-02-16 Thread Tom Ziemer
Hi, I have got a question quite unrelated to Struts: My app. is pretty much layered, meaning, I have Hibernate, on top of which there are SpringDAOs, on top of which are Managers that represent my business logic. Now I wonder, if it is possible, to *hide* (maybe with annotations?) my DAOs from al