panel
10-15-2007, 10:50 AM
Some time ago I started to build kind of framework (basicly containing usefull assets) and I wanna ask you about package naiming practices.
Let's say I am building some kind of player Player with own events and states.
First solution would be to put all classes in the same package
com.domain.video
---MyPlayer
---MyPlayerState
---MyPlayerEvents
The main disadvantage in this case for me it that MyPlayer class is in one package with 'helper' classes.
Secound aproach would be to split classes by 'type' and put them do diffrent packages.
com.domain.video
---MyPlayer
com.domain.consts
---MyPlayerState
com.domain.events
---MyPlayerEvents
I know it just metter of preferences. I just wanna know what do you think about secound aproach and how you deal with packages structure. Examples would be nice.
Let's say I am building some kind of player Player with own events and states.
First solution would be to put all classes in the same package
com.domain.video
---MyPlayer
---MyPlayerState
---MyPlayerEvents
The main disadvantage in this case for me it that MyPlayer class is in one package with 'helper' classes.
Secound aproach would be to split classes by 'type' and put them do diffrent packages.
com.domain.video
---MyPlayer
com.domain.consts
---MyPlayerState
com.domain.events
---MyPlayerEvents
I know it just metter of preferences. I just wanna know what do you think about secound aproach and how you deal with packages structure. Examples would be nice.