# Something like Java packages / namespaces?

**URL:** <https://forums.swift.org/t/something-like-java-packages-namespaces/47573>\
**Category:** Using Swift\
**Created:** [April 20, 2021, 8:23pm UTC](https://forums.swift.org/t/something-like-java-packages-namespaces/47573 "2021-04-20T20:23:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kirilltitov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kirilltitov/32/4182_2.png) [@kirilltitov](https://forums.swift.org/u/kirilltitov)\
**Post date:** [April 21, 2021, 10:39am UTC](https://forums.swift.org/t/something-like-java-packages-namespaces/47573/3 "2021-04-21T10:39:12Z")

</div>

Currently there is one moderately ugly workaround ([proposed](https://forums.swift.org/t/namespacing-protocols-to-other-types/7328/54) by @Karl) — defining an underscored protocol on top level and then creating a namespaced typealias:

```swift
public protocol _HiddenFeatureProtocol {
    // requirements
}

public enum Namespace {
    typealias FeatureProtocol = _HiddenFeatureProtocol
}

public struct FeatureImpl: Namespace.FeatureProtocol {
    // implementation
}

```

---

_[View the full topic](https://forums.swift.org/t/something-like-java-packages-namespaces/47573)._
