![]() |
|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#21
|
||||
|
||||
Sean, Plucky,
Thanks to both of you. I've been getting a little more comfortable with the Sun java docs but as always when learning something new the first few steps take a while. I am getting ready to delve into java programming. I'll try the _parseInt method to solve this particular problem. Plucky, If you do get around to making your methods accept integers I'd appreciate the jar. Tom
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#22
|
||||
|
||||
Quote:
Quote:
Plus there are other reasons besides clarity to prefer overloads to generic Object methods. In general you want the compiler to do as much type checking and method resolution as possible, both to avoid runtime overhead and to catch type errors as early as possible. Pass the wrong type to an overloaded method and you find out right away. Pass the wrong type to a method that takes Object and you might not find out until after your code ships.
__________________
-- Greg |
#23
|
||||
|
||||
Plucky,
I have my STV working using your current api's and the conversion methods you all pointed out to me. No need to create any special api's for integers (unless you need them for something else.) Please put all of your efforts into Ortus and SMM ![]() Tom
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#24
|
|||
|
|||
Quote:
Glad to hear I did send you a new jar last night ![]() |
#25
|
||||
|
||||
Quote:
My point was really about simplify the consumability of the api. While, I would never encourage writing method signatures that accept an object in normal java practice... it can be quite useful when dealing with the STV, and core sage does it as well ![]() By manually handling the type conversion, you can also provide better messages back to the user, which could improve the usability of the api, while adding in some overhead. ie, if my method accepts an Object but requires an int, then I can inform the user that they passed an invalid parameter type, and even dump the type in the message... as apposed to "unknown method", which even to a seasoned developer, you are left wondering if it's a typo in the method name or a signature issue. I find that writing APIs that are consumed by the stv, my approach changes. Users of the STV do not have benefit of the ide telling them that they are misspelled a method, or missing an arg, etc. To ensure the best of both worlds... I tend to write very specific typesafe apis (using generics and overloading, etc), but then I create an "API" that is published and meant to be directly consumed by the STV developers. Because I'm lazy, I also, tend to auto-generate those STV facing apis, and in some cases, using annotations, I allow for "Object" parameters that are manually converted to a specific type, for no other reason as to make it easier on the STV developers to use the API. The other advantage of this layered approach, is that I can also refactor the underlying apis while having minimal impact on the STV.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Recording Errors - Unknown Cause | jillsy | SageTV Software | 0 | 03-06-2009 12:44 AM |
HDPVR showing up as unknown device after replugging in. | personalt | Hardware Support | 9 | 11-02-2008 09:35 AM |
Error:Unknown Internal Screen on MC Main Menu | McBainWRX | SageMC Custom Interface | 2 | 08-01-2008 05:39 AM |
Fix for unknown wma "bug" | perry59 | SageTV Software | 1 | 10-31-2007 10:29 AM |
HD channel tuning and guide data for an 'unknown' channel | snoopy | SageTV EPG Service | 5 | 05-04-2007 11:24 AM |